From 9572c5c3891e7d2ed838752f1fba0f6d2ddde512 Mon Sep 17 00:00:00 2001 From: Michael Schuett Date: Tue, 16 May 2017 15:27:16 -0400 Subject: [PATCH 1/3] Dynamic Enum Fix Adds support so that when a value that is of type Dynamic Enum is updated after initial intake the values are cleared from the initial run and the new ones are added. --- app/collins/models/AssetMeta.scala | 5 +++++ app/collins/models/LshwHelper.scala | 2 ++ app/collins/models/shared/CommonHelper.scala | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/collins/models/AssetMeta.scala b/app/collins/models/AssetMeta.scala index a8d13c6ae..95f10c3f5 100644 --- a/app/collins/models/AssetMeta.scala +++ b/app/collins/models/AssetMeta.scala @@ -201,6 +201,7 @@ object AssetMeta extends Schema with AnormAdapter[AssetMeta] with AssetMetaKeys } // Post enum fields, enum is not safe to extend with new values + type DynamicEnum = AssetMeta object DynamicEnum { val BaseDescription = findOrCreateFromName("BASE_DESCRIPTION") val BaseProduct = findOrCreateFromName("BASE_PRODUCT") @@ -210,5 +211,9 @@ object AssetMeta extends Schema with AnormAdapter[AssetMeta] with AssetMetaKeys def getValues(): Seq[AssetMeta] = { Seq(BaseDescription, BaseProduct, BaseVendor, BaseSerial) } + + def getLshwValues(): Set[AssetMeta] = { + Set(BaseDescription, BaseProduct, BaseVendor, BaseSerial) + } } } diff --git a/app/collins/models/LshwHelper.scala b/app/collins/models/LshwHelper.scala index 72df84c8c..c746bcc38 100644 --- a/app/collins/models/LshwHelper.scala +++ b/app/collins/models/LshwHelper.scala @@ -34,6 +34,8 @@ object LshwHelper extends CommonHelper[LshwRepresentation] { DiskStorageTotal ) + override val managedDynamicTags = AssetMeta.DynamicEnum.getLshwValues() + def construct(asset: Asset, lshw: LshwRepresentation): Seq[AssetMetaValue] = { collectCpus(asset, lshw) ++ collectMemory(asset, lshw) ++ diff --git a/app/collins/models/shared/CommonHelper.scala b/app/collins/models/shared/CommonHelper.scala index 142b2341f..dde068d3b 100644 --- a/app/collins/models/shared/CommonHelper.scala +++ b/app/collins/models/shared/CommonHelper.scala @@ -10,6 +10,7 @@ trait CommonHelper[T] { type FilteredSeq[T1] = Tuple2[Seq[T1], Map[Int, Seq[MetaWrapper]]] val managedTags: Set[AssetMeta.Enum] + val managedDynamicTags: Set[AssetMeta] = Set() /** * Construct an appropriate AssetMetaValue sequence from the representation @@ -27,7 +28,7 @@ trait CommonHelper[T] { def updateAsset(asset: Asset, rep: T): Boolean = { val mvs = construct(asset, rep) if (!managedTags.isEmpty) { - AssetMetaValue.deleteByAssetAndMetaId(asset, managedTags.map(_.id.toLong)) + AssetMetaValue.deleteByAssetAndMetaId(asset, ((managedTags.map(_.id.toLong) ++ managedDynamicTags.map(_.id)))) } mvs.size == AssetMetaValue.create(mvs) From ae2784aa476859481fcf5caab384ff25c073a99d Mon Sep 17 00:00:00 2001 From: Michael Schuett Date: Sun, 21 May 2017 02:50:33 -0400 Subject: [PATCH 2/3] Add Sweet Dynamic Enum Tests Checks to ensure that we are properly updating assets in the database cleaning up old values and returning the new ones. --- app/collins/models/AssetMeta.scala | 1 - test/collins/controllers/AssetApiHelper.scala | 6 +- test/collins/models/DynamicEnumSpec.scala | 69 + test/resources/lshw-basic-dynamic-enums.xml | 1565 +++++++++++++++++ 4 files changed, 1637 insertions(+), 4 deletions(-) create mode 100644 test/collins/models/DynamicEnumSpec.scala create mode 100644 test/resources/lshw-basic-dynamic-enums.xml diff --git a/app/collins/models/AssetMeta.scala b/app/collins/models/AssetMeta.scala index 95f10c3f5..6a011ef05 100644 --- a/app/collins/models/AssetMeta.scala +++ b/app/collins/models/AssetMeta.scala @@ -201,7 +201,6 @@ object AssetMeta extends Schema with AnormAdapter[AssetMeta] with AssetMetaKeys } // Post enum fields, enum is not safe to extend with new values - type DynamicEnum = AssetMeta object DynamicEnum { val BaseDescription = findOrCreateFromName("BASE_DESCRIPTION") val BaseProduct = findOrCreateFromName("BASE_PRODUCT") diff --git a/test/collins/controllers/AssetApiHelper.scala b/test/collins/controllers/AssetApiHelper.scala index d4c5393b7..53d41b733 100644 --- a/test/collins/controllers/AssetApiHelper.scala +++ b/test/collins/controllers/AssetApiHelper.scala @@ -54,9 +54,9 @@ trait AssetApiHelper extends ResponseMatchHelpers with JsonMatchers with Control result } - def updateHwInfo() = { + def updateHwInfo(lshwXml: String = "lshw-basic.xml") = { // update hw details (lshw / lldp) - cannot proceed without this - val lshwData = getResource("lshw-basic.xml") + val lshwData = getResource(lshwXml) val lldpData = getResource("lldpctl-two-nic.xml") val dummy = Seq[FilePart[TemporaryFile]]() val mdf = MultipartFormData(Map( @@ -73,4 +73,4 @@ trait AssetApiHelper extends ResponseMatchHelpers with JsonMatchers with Control val request = FakeRequest("GET", assetUrl) Extract.from(api.getAsset(assetTag).apply(request)) } -} \ No newline at end of file +} diff --git a/test/collins/models/DynamicEnumSpec.scala b/test/collins/models/DynamicEnumSpec.scala new file mode 100644 index 000000000..681d8a050 --- /dev/null +++ b/test/collins/models/DynamicEnumSpec.scala @@ -0,0 +1,69 @@ +package collins.controllers + +import org.specs2.mutable + +import play.api.libs.json.JsString +import play.api.libs.json.Json +import play.api.test.FakeApplication +import play.api.test.WithApplication + +import collins.FakeRequest +import collins.ResourceFinder +import collins.models.Asset +import collins.models.AssetMeta +import collins.models.AssetMetaValue +import collins.models.Status + +class DynamicEnumSpec extends mutable.Specification with ControllerSpec with ResourceFinder { + + "Dynamic Enum Specification".title + + "Should properly update asset" should { + + "Has data integrity" in { + "Creating an asset" in new WithApplication(FakeApplication( + additionalConfiguration = Map( + "solr.enabled" -> false))) with AssetApiHelper { + override val assetTag = "A0001" + createAsset() must haveStatus(201) + updateHwInfo() must haveStatus(200) + + val result = getAsset() + result must haveStatus(200) + result must haveJsonData.which { s => + s must /("data") */ ("HARDWARE") */ ("BASE") / ("DESCRIPTION" -> "Rack Mount Chassis") + s must /("data") */ ("HARDWARE") */ ("BASE") / ("PRODUCT" -> "PowerEdge C6105 (N/A)") + s must /("data") */ ("HARDWARE") */ ("BASE") / ("VENDOR" -> "Winbond Electronics") + s must /("data") */ ("HARDWARE") */ ("BASE") / ("SERIAL" -> "FZ22YQ1") + } + } + "Updating an asset" in new WithApplication(FakeApplication( + additionalConfiguration = Map( + "solr.enabled" -> false))) with AssetApiHelper { + override val assetTag = "A0002" + createAsset() must haveStatus(201) + // Update HW info twice to ensure that we are + // overwriting the data from the first intake + updateHwInfo() must haveStatus(200) + updateStatus(Status.Maintenance.get, "refresh lshw") must haveStatus(200) + updateHwInfo("lshw-basic-dynamic-enums.xml") must haveStatus(200) + + val asset = Asset.findByTag(assetTag).get + val atts = AssetMetaValue.findByAsset(asset) + atts.count(_.getName() == "BASE_DESCRIPTION") mustEqual 1 + atts.count(_.getName() == "BASE_PRODUCT") mustEqual 1 + atts.count(_.getName() == "BASE_VENDOR") mustEqual 1 + atts.count(_.getName() == "BASE_SERIAL") mustEqual 1 + + val result = getAsset() + result must haveStatus(200) + result must haveJsonData.which { s => + s must /("data") */ ("HARDWARE") */ ("BASE") / ("DESCRIPTION" -> "Rack Mount Chassis 2") + s must /("data") */ ("HARDWARE") */ ("BASE") / ("PRODUCT" -> "PowerEdge C6105 2") + s must /("data") */ ("HARDWARE") */ ("BASE") / ("VENDOR" -> "Winbond Electronics 2") + s must /("data") */ ("HARDWARE") */ ("BASE") / ("SERIAL" -> "FZ22YQ2") + } + } + } + } +} diff --git a/test/resources/lshw-basic-dynamic-enums.xml b/test/resources/lshw-basic-dynamic-enums.xml new file mode 100644 index 000000000..04f343d07 --- /dev/null +++ b/test/resources/lshw-basic-dynamic-enums.xml @@ -0,0 +1,1565 @@ + + + + + + + Rack Mount Chassis 2 + PowerEdge C6105 2 + Winbond Electronics 2 + N/A + FZ22YQ2 + 64 + + + + + + + + + SMBIOS version 2.6 + DMI version 2.6 + 64-bit processes + 32-bit processes + + + Motherboard + 001V46 + Winbond Electronics + 0 + A01 + .FZ22YQ1.CN7170315N0004. + N/A + + BIOS + Winbond Electronics + 1 + 1.7.6 + 04/21/2011 + 65536 + 4128768 + + ISA bus + PCI bus + Plug-and-Play + BIOS EEPROM can be upgraded + BIOS shadowing + ESCD + Booting from CD-ROM/DVD + Selectable boot path + BIOS ROM is socketed + Enhanced Disk Drive extensions + Print Screen key + INT14 serial line control + INT17 printer control + INT10 CGA/Mono video + ACPI + USB legacy emulation + Booting from LS-120 + Booting from ATAPI ZIP + BIOS boot specification + + + + CPU + AMD Opteron(tm) Processor 4174 HE + Hynix Semiconductor (Hyundai Electronics) + 5 + cpu@0 + D1 + To Be Filled By O.E.M. + CPU 0 + 2300000000 + 2300000000 + 64 + 200000000 + + + + + + + 64bits extensions (x86-64) + mathematical co-processor + FPU exceptions reporting + + virtual mode extensions + debugging extensions + page size extensions + time stamp counter + model-specific registers + 4GB+ memory addressing (Physical Address Extension) + machine check exceptions + compare and exchange 8-byte + on-chip advanced programmable interrupt controller (APIC) + memory type range registers + page global enable + machine check architecture + conditional move instruction + page attribute table + 36-bit page size extensions + + multimedia extensions (MMX) + fast floating point save/restore + streaming SIMD extensions (SSE) + streaming SIMD extensions (SSE2) + HyperThreading + fast system calls + no-execute bit (NX) + multimedia extensions (MMXExt) + + + + multimedia extensions (3DNow!Ext) + multimedia extensions (3DNow!) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + L1 cache + 6 + L1-Cache + 786432 + 786432 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L2 cache + 7 + L2-Cache + 3145728 + 3145728 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L3 cache + 8 + L3-Cache + 6291456 + 6291456 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + + CPU + AMD Opteron(tm) Processor 4174 HE + Hynix Semiconductor (Hyundai Electronics) + 9 + cpu@1 + D1 + To Be Filled By O.E.M. + CPU 1 + 2300000000 + 2300000000 + 64 + 200000000 + + + + + + + 64bits extensions (x86-64) + mathematical co-processor + FPU exceptions reporting + + virtual mode extensions + debugging extensions + page size extensions + time stamp counter + model-specific registers + 4GB+ memory addressing (Physical Address Extension) + machine check exceptions + compare and exchange 8-byte + on-chip advanced programmable interrupt controller (APIC) + memory type range registers + page global enable + machine check architecture + conditional move instruction + page attribute table + 36-bit page size extensions + + multimedia extensions (MMX) + fast floating point save/restore + streaming SIMD extensions (SSE) + streaming SIMD extensions (SSE2) + HyperThreading + fast system calls + no-execute bit (NX) + multimedia extensions (MMXExt) + + + + multimedia extensions (3DNow!Ext) + multimedia extensions (3DNow!) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + L1 cache + a + L1-Cache + 786432 + 786432 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L2 cache + b + L2-Cache + 3145728 + 3145728 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + L3 cache + c + L3-Cache + 6291456 + 6291456 + 1000000000 + + Pipeline burst + Internal + Write-back + Unified cache + + + + + System Memory + 28 + System board or motherboard + 34359738368 + + DIMM DDR3 Synchronous [empty] + ModulePartNumber00 + Manufacturer00 + 0 + SerNum00 + CPU0 DIMM A0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber01 + Manufacturer01 + 1 + SerNum01 + CPU0 DIMM A1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + HMT31GR7BFR4A-H9 + Hyundai + 2 + 8AF9A71E + CPU0 DIMM A2 + 8589934592 + 64 + 1333000000 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber03 + Manufacturer03 + 3 + SerNum03 + CPU0 DIMM B0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber04 + Manufacturer04 + 4 + SerNum04 + CPU0 DIMM B1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + HMT31GR7BFR4A-H9 + Hyundai + 5 + 8BF9171E + CPU0 DIMM B2 + 8589934592 + 64 + 1333000000 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber06 + Manufacturer06 + 6 + SerNum06 + CPU1 DIMM C0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber07 + Manufacturer07 + 7 + SerNum07 + CPU1 DIMM C1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + HMT31GR7BFR4A-H9 + Hyundai + 8 + 95F9871E + CPU1 DIMM C2 + 8589934592 + 64 + 1333000000 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber09 + Manufacturer09 + 9 + SerNum09 + CPU1 DIMM D0 + + + DIMM DDR3 Synchronous [empty] + ModulePartNumber10 + Manufacturer10 + a + SerNum10 + CPU1 DIMM D1 + + + DIMM DDR3 Synchronous 1333 MHz (0.8 ns) + HMT31GR7BFR4A-H9 + Hyundai + b + A2F9B71E + CPU1 DIMM D2 + 8589934592 + 64 + 1333000000 + + + + Host bridge + RD890 Northbridge only dual slot (2x8) PCI-e GFX Hydra part + ATI Technologies Inc + 100 + pci@0000:00:00.0 + 02 + 32 + 33000000 + + PCI bridge + RD890 PCI to PCI bridge (PCI express gpp port D) + ATI Technologies Inc + 4 + pci@0000:00:04.0 + 00 + 32 + 33000000 + + + + + + Power Management + PCI Express + Message Signalled Interrupts + HyperTransport + + bus mastering + PCI capabilities listing + + + + + + + + Ethernet interface + 82576 Gigabit Network Connection + Intel Corporation + 0 + pci@0000:02:00.0 + eth0 + 01 + e8:9a:8f:23:15:72 + 1000000000 + 1000000000 + 32 + 33000000 + + + + + + + + + + + + + + + + Power Management + Message Signalled Interrupts + MSI-X + PCI Express + bus mastering + PCI capabilities listing + extension ROM + + Physical interface + twisted pair + 10Mbit/s + 10Mbit/s (full duplex) + 100Mbit/s + 100Mbit/s (full duplex) + 1Gbit/s (full duplex) + Auto-negotiation + + + + + + + + + + + + Ethernet interface + 82576 Gigabit Network Connection + Intel Corporation + 0.1 + pci@0000:02:00.1 + eth1 + 01 + e8:9a:8f:23:15:72 + 1000000000 + 32 + 33000000 + + + + + + + + + + + + + + Power Management + Message Signalled Interrupts + MSI-X + PCI Express + bus mastering + PCI capabilities listing + extension ROM + + Physical interface + twisted pair + 10Mbit/s + 10Mbit/s (full duplex) + 100Mbit/s + 100Mbit/s (full duplex) + 1Gbit/s (full duplex) + Auto-negotiation + + + + + + + + + + + + + SATA controller + SB700/SB800 SATA Controller [IDE mode] + ATI Technologies Inc + 11 + pci@0000:00:11.0 + scsi0 + scsi1 + scsi2 + scsi3 + 00 + 32 + 66000000 + + + + + + + Power Management + + bus mastering + PCI capabilities listing + Emulated device + + + + + + + + + + + + ATA Disk + ST91000640NS + Seagate + 0 + scsi@0:0.0.0 + /dev/sda + 8:0 + n/a + 9XG0D5M6 + 1000204886016 + + + + + + Partitioned disk + MS-DOS partition table + + + Linux raid autodetect partition + 1 + scsi@0:0.0.0,1 + /dev/sda1 + 8:1 + 999125155840 + + Primary partition + Multi-volumes + + + + EXT4 volume + Linux + 2 + scsi@0:0.0.0,2 + /dev/sda2 + 8:2 + 1.0 + 183cf9df-e0a1-4dfc-bb3c-63078ae644a8 + 1073729536 + 1073741824 + + + + + + + + + + Primary partition + Bootable partition (active) + Multi-volumes + + Extended Attributes + 4GB+ files + 16TB+ files + directories with 65000+ subdirs + needs recovery + extent-based allocation + + EXT2/EXT3 + initialized volume + + + + + ATA Disk + ST91000640NS + Seagate + 1 + scsi@1:0.0.0 + /dev/sdb + 8:16 + n/a + 9XG0EWV0 + 1000204886016 + + + + + + Partitioned disk + MS-DOS partition table + + + Linux raid autodetect partition + 1 + scsi@1:0.0.0,1 + /dev/sdb1 + 8:17 + 970813603840 + + Primary partition + Multi-volumes + + + + EXT4 volume + Linux + 2 + scsi@1:0.0.0,2 + /dev/sdb2 + 8:18 + 1.0 + 183cf9df-e0a1-4dfc-bb3c-63078ae644a8 + 1073729536 + 1073741824 + + + + + + + + + + Primary partition + Bootable partition (active) + Multi-volumes + + Extended Attributes + 4GB+ files + 16TB+ files + directories with 65000+ subdirs + needs recovery + extent-based allocation + + EXT2/EXT3 + initialized volume + + + + + ATA Disk + ST91000640NS + Seagate + 2 + scsi@2:0.0.0 + /dev/sdc + 8:32 + n/a + 9XG0DTSF + 1000204886016 + + + + + + Partitioned disk + MS-DOS partition table + + + Linux raid autodetect partition + 1 + scsi@2:0.0.0,1 + /dev/sdc1 + 8:33 + 999125155840 + + Primary partition + Multi-volumes + + + + EXT4 volume + Linux + 2 + scsi@2:0.0.0,2 + /dev/sdc2 + 8:34 + 1.0 + 183cf9df-e0a1-4dfc-bb3c-63078ae644a8 + 1073729536 + 1073741824 + + + + + + + + + + Primary partition + Bootable partition (active) + Multi-volumes + + Extended Attributes + 4GB+ files + 16TB+ files + directories with 65000+ subdirs + needs recovery + extent-based allocation + + EXT2/EXT3 + initialized volume + + + + + ATA Disk + ST91000640NS + Seagate + 3 + scsi@3:0.0.0 + /dev/sdd + 8:48 + n/a + 9XG0DQHV + 1000204886016 + + + + + + Partitioned disk + MS-DOS partition table + + + Linux raid autodetect partition + 1 + scsi@3:0.0.0,1 + /dev/sdd1 + 8:49 + 999125155840 + + Primary partition + Multi-volumes + + + + EXT4 volume + Linux + 2 + scsi@3:0.0.0,2 + /dev/sdd2 + 8:50 + 1.0 + 183cf9df-e0a1-4dfc-bb3c-63078ae644a8 + 1073729536 + 1073741824 + + + + + + + + + + Primary partition + Bootable partition (active) + Multi-volumes + + Extended Attributes + 4GB+ files + 16TB+ files + directories with 65000+ subdirs + needs recovery + extent-based allocation + + EXT2/EXT3 + initialized volume + + + + + + USB Controller + SB700/SB800 USB OHCI0 Controller + ATI Technologies Inc + 12 + pci@0000:00:12.0 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.32-71.29.1.el6.x86_64 ohci_hcd + 1 + usb@3 + usb3 + 2.06 + + + + + + + USB 1.1 + + + + + USB Controller + SB700 USB OHCI1 Controller + ATI Technologies Inc + 12.1 + pci@0000:00:12.1 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.32-71.29.1.el6.x86_64 ohci_hcd + 1 + usb@4 + usb4 + 2.06 + + + + + + + USB 1.1 + + + + + USB Controller + SB700/SB800 USB EHCI Controller + ATI Technologies Inc + 12.2 + pci@0000:00:12.2 + 00 + 32 + 66000000 + + + + + + Power Management + Debug port + Enhanced Host Controller Interface (USB2) + bus mastering + PCI capabilities listing + + + + + + + EHCI Host Controller + Linux 2.6.32-71.29.1.el6.x86_64 ehci_hcd + 1 + usb@1 + usb1 + 2.06 + + + + + + + USB 2.0 + + + USB hub + Generic Hub + American Megatrends Inc. + 2 + usb@1:2 + 1.00 + serial + + + + + + + USB 2.0 + + + Keyboard + Virtual Keyboard and Mouse + American Megatrends Inc. + 1 + usb@1:2.1 + 1.00 + serial + + + + + + USB 2.0 + + + + + + + USB Controller + SB700/SB800 USB OHCI0 Controller + ATI Technologies Inc + 13 + pci@0000:00:13.0 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.32-71.29.1.el6.x86_64 ohci_hcd + 1 + usb@5 + usb5 + 2.06 + + + + + + + USB 1.1 + + + + + USB Controller + SB700 USB OHCI1 Controller + ATI Technologies Inc + 13.1 + pci@0000:00:13.1 + 00 + 32 + 66000000 + + + + + + Open Host Controller Interface + bus mastering + + + + + + + OHCI Host Controller + Linux 2.6.32-71.29.1.el6.x86_64 ohci_hcd + 1 + usb@6 + usb6 + 2.06 + + + + + + + USB 1.1 + + + + + USB Controller + SB700/SB800 USB EHCI Controller + ATI Technologies Inc + 13.2 + pci@0000:00:13.2 + 00 + 32 + 66000000 + + + + + + Power Management + Debug port + Enhanced Host Controller Interface (USB2) + bus mastering + PCI capabilities listing + + + + + + + EHCI Host Controller + Linux 2.6.32-71.29.1.el6.x86_64 ehci_hcd + 1 + usb@2 + usb2 + 2.06 + + + + + + + USB 2.0 + + + + + SMBus + SBx00 SMBus Controller + ATI Technologies Inc + 14 + pci@0000:00:14.0 + 3d + 32 + 66000000 + + + + + + HyperTransport + PCI capabilities listing + + + + + + + IDE interface + SB700/SB800 IDE Controller + ATI Technologies Inc + 14.1 + pci@0000:00:14.1 + scsi4 + 00 + 32 + 66000000 + + + + + + + Message Signalled Interrupts + bus mastering + PCI capabilities listing + Emulated device + + + + + + + + + + + ATA Disk + ST91000640NS + Seagate + 0.0.0 + scsi@4:0.0.0 + /dev/sde + 8:64 + n/a + 9XG0CJZ5 + 1000204886016 + + + + + + Partitioned disk + MS-DOS partition table + + + Linux raid autodetect partition + 1 + scsi@4:0.0.0,1 + /dev/sde1 + 8:65 + 999125155840 + + Primary partition + Multi-volumes + + + + Linux raid autodetect partition + 2 + scsi@4:0.0.0,2 + /dev/sde2 + 8:66 + 1073741824 + + Primary partition + Multi-volumes + + + + + ATA Disk + ST91000640NS + Seagate + 0.1.0 + scsi@4:0.1.0 + /dev/sdf + 8:80 + n/a + 9XG0ETB8 + 1000204886016 + + + + + + Partitioned disk + MS-DOS partition table + + + Linux raid autodetect partition + 1 + scsi@4:0.1.0,1 + /dev/sdf1 + 8:81 + 999125155840 + + Primary partition + Multi-volumes + + + + Linux raid autodetect partition + 2 + scsi@4:0.1.0,2 + /dev/sdf2 + 8:82 + 1073741824 + + Primary partition + Multi-volumes + + + + + + ISA bridge + SB700/SB800 LPC host controller + ATI Technologies Inc + 14.3 + pci@0000:00:14.3 + 00 + 32 + 66000000 + + + + + + bus mastering + + + + PCI bridge + SBx00 PCI to PCI Bridge + ATI Technologies Inc + 14.4 + pci@0000:00:14.4 + 00 + 32 + 66000000 + + + + bus mastering + + + + + + + VGA compatible controller + ASPEED Graphics Family + ASPEED Technology, Inc. + b + pci@0000:01:0b.0 + 10 + 32 + 33000000 + + + + + Power Management + + PCI capabilities listing + + + + + + + + + + + Host bridge + Family 10h Processor HyperTransport Configuration + Hynix Semiconductor (Hyundai Electronics) + 101 + pci@0000:00:18.0 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor Address Map + Hynix Semiconductor (Hyundai Electronics) + 102 + pci@0000:00:18.1 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor DRAM Controller + Hynix Semiconductor (Hyundai Electronics) + 103 + pci@0000:00:18.2 + 00 + 32 + 33000000 + + + + + + + + + Host bridge + Family 10h Processor Miscellaneous Control + Hynix Semiconductor (Hyundai Electronics) + 104 + pci@0000:00:18.3 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor Link Control + Hynix Semiconductor (Hyundai Electronics) + 105 + pci@0000:00:18.4 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor HyperTransport Configuration + Hynix Semiconductor (Hyundai Electronics) + 106 + pci@0000:00:19.0 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor Address Map + Hynix Semiconductor (Hyundai Electronics) + 107 + pci@0000:00:19.1 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor DRAM Controller + Hynix Semiconductor (Hyundai Electronics) + 108 + pci@0000:00:19.2 + 00 + 32 + 33000000 + + + + + + + + + Host bridge + Family 10h Processor Miscellaneous Control + Hynix Semiconductor (Hyundai Electronics) + 109 + pci@0000:00:19.3 + 00 + 32 + 33000000 + + + Host bridge + Family 10h Processor Link Control + Hynix Semiconductor (Hyundai Electronics) + 10a + pci@0000:00:19.4 + 00 + 32 + 33000000 + + + + Ethernet interface + 1 + bond0 + e8:9a:8f:23:15:72 + + + + + + + + + + + + Physical interface + + + + Ethernet interface + 2 + bond0.100 + e8:9a:8f:23:15:72 + + + + + + + + + + + + Physical interface + + + + Ethernet interface + 3 + bond0.101 + e8:9a:8f:23:15:72 + + + + + + + + + + + + Physical interface + + + + Ethernet interface + 4 + bond0.103 + e8:9a:8f:23:15:72 + + + + + + + + + + + + Physical interface + + + + Ethernet interface + 5 + bond0.105 + e8:9a:8f:23:15:72 + + + + + + + + + + + + + Physical interface + + + + Ethernet interface + 6 + vnet0 + fe:54:00:52:1a:d7 + 10000000 + + + + + + + + + + + + + + + Physical interface + + + From 0e56e5041e9f6e2fc6742a63f4eff0c98e90a504 Mon Sep 17 00:00:00 2001 From: Michael Schuett Date: Sun, 21 May 2017 03:19:36 -0400 Subject: [PATCH 3/3] Parameterize LLDP XML Allow for optionally overwritting the LLDP XML used when updating an asset for testing. --- test/collins/controllers/AssetApiHelper.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/collins/controllers/AssetApiHelper.scala b/test/collins/controllers/AssetApiHelper.scala index 53d41b733..c1901b0c6 100644 --- a/test/collins/controllers/AssetApiHelper.scala +++ b/test/collins/controllers/AssetApiHelper.scala @@ -54,10 +54,10 @@ trait AssetApiHelper extends ResponseMatchHelpers with JsonMatchers with Control result } - def updateHwInfo(lshwXml: String = "lshw-basic.xml") = { + def updateHwInfo(lshwXml: String = "lshw-basic.xml", lldpXml: String = "lldpctl-two-nic.xml") = { // update hw details (lshw / lldp) - cannot proceed without this val lshwData = getResource(lshwXml) - val lldpData = getResource("lldpctl-two-nic.xml") + val lldpData = getResource(lldpXml) val dummy = Seq[FilePart[TemporaryFile]]() val mdf = MultipartFormData(Map( "lshw" -> Seq(lshwData),