[pve-devel] [PATCH storage 7/7] add disk usages regression test

Dominik Csapak d.csapak at proxmox.com
Mon Oct 17 10:31:27 CEST 2016


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 test/disk_tests/usages/disklist               |  6 ++
 test/disk_tests/usages/disklist_expected.json | 97 +++++++++++++++++++++++++++
 test/disk_tests/usages/mounts                 |  2 +
 test/disk_tests/usages/partlist               |  2 +
 test/disk_tests/usages/pvs                    |  1 +
 test/disk_tests/usages/sda/device/vendor      |  1 +
 test/disk_tests/usages/sda/queue/rotational   |  1 +
 test/disk_tests/usages/sda/size               |  1 +
 test/disk_tests/usages/sda_udevadm            | 12 ++++
 test/disk_tests/usages/sdb/device/vendor      |  1 +
 test/disk_tests/usages/sdb/queue/rotational   |  1 +
 test/disk_tests/usages/sdb/size               |  1 +
 test/disk_tests/usages/sdb_udevadm            | 12 ++++
 test/disk_tests/usages/sdc/device/vendor      |  1 +
 test/disk_tests/usages/sdc/queue/rotational   |  1 +
 test/disk_tests/usages/sdc/size               |  1 +
 test/disk_tests/usages/sdc_udevadm            | 12 ++++
 test/disk_tests/usages/sdd/device/vendor      |  1 +
 test/disk_tests/usages/sdd/queue/rotational   |  1 +
 test/disk_tests/usages/sdd/size               |  1 +
 test/disk_tests/usages/sdd_udevadm            | 12 ++++
 test/disk_tests/usages/sde/device/vendor      |  1 +
 test/disk_tests/usages/sde/queue/rotational   |  1 +
 test/disk_tests/usages/sde/size               |  1 +
 test/disk_tests/usages/sde_udevadm            | 12 ++++
 test/disk_tests/usages/sdf/device/vendor      |  1 +
 test/disk_tests/usages/sdf/queue/rotational   |  1 +
 test/disk_tests/usages/sdf/size               |  1 +
 test/disk_tests/usages/sdf_udevadm            | 12 ++++
 test/disk_tests/usages/zpool                  |  6 ++
 30 files changed, 204 insertions(+)
 create mode 100644 test/disk_tests/usages/disklist
 create mode 100644 test/disk_tests/usages/disklist_expected.json
 create mode 100644 test/disk_tests/usages/mounts
 create mode 100644 test/disk_tests/usages/partlist
 create mode 100644 test/disk_tests/usages/pvs
 create mode 100644 test/disk_tests/usages/sda/device/vendor
 create mode 100644 test/disk_tests/usages/sda/queue/rotational
 create mode 100644 test/disk_tests/usages/sda/size
 create mode 100644 test/disk_tests/usages/sda_udevadm
 create mode 100644 test/disk_tests/usages/sdb/device/vendor
 create mode 100644 test/disk_tests/usages/sdb/queue/rotational
 create mode 100644 test/disk_tests/usages/sdb/size
 create mode 100644 test/disk_tests/usages/sdb_udevadm
 create mode 100644 test/disk_tests/usages/sdc/device/vendor
 create mode 100644 test/disk_tests/usages/sdc/queue/rotational
 create mode 100644 test/disk_tests/usages/sdc/size
 create mode 100644 test/disk_tests/usages/sdc_udevadm
 create mode 100644 test/disk_tests/usages/sdd/device/vendor
 create mode 100644 test/disk_tests/usages/sdd/queue/rotational
 create mode 100644 test/disk_tests/usages/sdd/size
 create mode 100644 test/disk_tests/usages/sdd_udevadm
 create mode 100644 test/disk_tests/usages/sde/device/vendor
 create mode 100644 test/disk_tests/usages/sde/queue/rotational
 create mode 100644 test/disk_tests/usages/sde/size
 create mode 100644 test/disk_tests/usages/sde_udevadm
 create mode 100644 test/disk_tests/usages/sdf/device/vendor
 create mode 100644 test/disk_tests/usages/sdf/queue/rotational
 create mode 100644 test/disk_tests/usages/sdf/size
 create mode 100644 test/disk_tests/usages/sdf_udevadm
 create mode 100644 test/disk_tests/usages/zpool

diff --git a/test/disk_tests/usages/disklist b/test/disk_tests/usages/disklist
new file mode 100644
index 0000000..b5daaf1
--- /dev/null
+++ b/test/disk_tests/usages/disklist
@@ -0,0 +1,6 @@
+sda
+sdb
+sdc
+sdd
+sde
+sdf
diff --git a/test/disk_tests/usages/disklist_expected.json b/test/disk_tests/usages/disklist_expected.json
new file mode 100644
index 0000000..3d1241c
--- /dev/null
+++ b/test/disk_tests/usages/disklist_expected.json
@@ -0,0 +1,97 @@
+{
+    "sdf" : {
+	"gpt" : 1,
+	"rpm" : 0,
+	"size" : 1536000,
+	"type" : "hdd",
+	"osdid" : "444",
+	"health" : "UNKNOWN",
+	"model" : "MODEL1",
+	"used" : "mounted",
+	"journals" : 0,
+	"wearout" : "N/A",
+	"wwn" : "0x0000000000000000",
+	"devpath" : "/dev/sdf",
+	"vendor" : "ATA",
+	"serial" : "SERIAL1"
+    },
+    "sde" : {
+	"wwn" : "0x0000000000000000",
+	"devpath" : "/dev/sde",
+	"serial" : "SERIAL1",
+	"vendor" : "ATA",
+	"health" : "UNKNOWN",
+	"rpm" : 0,
+	"size" : 1536000,
+	"gpt" : 1,
+	"osdid" : -1,
+	"type" : "hdd",
+	"model" : "MODEL1",
+	"used" : "Device Mapper",
+	"journals" : 0,
+	"wearout" : "N/A"
+    },
+    "sdb" : {
+	"serial" : "SERIAL1",
+	"vendor" : "ATA",
+	"wwn" : "0x0000000000000000",
+	"devpath" : "/dev/sdb",
+	"model" : "MODEL1",
+	"used" : "LVM",
+	"journals" : 0,
+	"wearout" : "N/A",
+	"health" : "UNKNOWN",
+	"gpt" : 1,
+	"size" : 1536000,
+	"rpm" : 0,
+	"type" : "hdd",
+	"osdid" : -1
+    },
+    "sda" : {
+	"model" : "MODEL1",
+	"used" : "mounted",
+	"journals" : 0,
+	"wearout" : "N/A",
+	"health" : "UNKNOWN",
+	"gpt" : 1,
+	"size" : 1536000,
+	"rpm" : 0,
+	"type" : "hdd",
+	"osdid" : -1,
+	"serial" : "SERIAL1",
+	"vendor" : "ATA",
+	"wwn" : "0x0000000000000000",
+	"devpath" : "/dev/sda"
+    },
+    "sdc" : {
+	"serial" : "SERIAL1",
+	"vendor" : "ATA",
+	"devpath" : "/dev/sdc",
+	"wwn" : "0x0000000000000000",
+	"used" : "ZFS",
+	"journals" : 0,
+	"wearout" : "N/A",
+	"model" : "MODEL1",
+	"health" : "UNKNOWN",
+	"type" : "hdd",
+	"osdid" : -1,
+	"gpt" : 1,
+	"rpm" : 0,
+	"size" : 1536000
+    },
+    "sdd" : {
+	"model" : "MODEL1",
+	"journals" : 0,
+	"wearout" : "N/A",
+	"health" : "UNKNOWN",
+	"size" : 1536000,
+	"rpm" : 0,
+	"gpt" : 1,
+	"type" : "hdd",
+	"osdid" : -1,
+	"serial" : "SERIAL1",
+	"vendor" : "ATA",
+	"wwn" : "0x0000000000000000",
+	"devpath" : "/dev/sdd"
+    }
+}
diff --git a/test/disk_tests/usages/mounts b/test/disk_tests/usages/mounts
new file mode 100644
index 0000000..f8c1cd3
--- /dev/null
+++ b/test/disk_tests/usages/mounts
@@ -0,0 +1,2 @@
+/dev/sda /mountpoint1
+/dev/sdf1 /var/lib/ceph/osd/ceph-444
diff --git a/test/disk_tests/usages/partlist b/test/disk_tests/usages/partlist
new file mode 100644
index 0000000..8dcdefc
--- /dev/null
+++ b/test/disk_tests/usages/partlist
@@ -0,0 +1,2 @@
+sde1
+sdf1
diff --git a/test/disk_tests/usages/pvs b/test/disk_tests/usages/pvs
new file mode 100644
index 0000000..ab3ff75
--- /dev/null
+++ b/test/disk_tests/usages/pvs
@@ -0,0 +1 @@
+  /dev/sdb 
diff --git a/test/disk_tests/usages/sda/device/vendor b/test/disk_tests/usages/sda/device/vendor
new file mode 100644
index 0000000..531030d
--- /dev/null
+++ b/test/disk_tests/usages/sda/device/vendor
@@ -0,0 +1 @@
+ATA
diff --git a/test/disk_tests/usages/sda/queue/rotational b/test/disk_tests/usages/sda/queue/rotational
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/disk_tests/usages/sda/queue/rotational
@@ -0,0 +1 @@
+1
diff --git a/test/disk_tests/usages/sda/size b/test/disk_tests/usages/sda/size
new file mode 100644
index 0000000..13de30f
--- /dev/null
+++ b/test/disk_tests/usages/sda/size
@@ -0,0 +1 @@
+3000
diff --git a/test/disk_tests/usages/sda_udevadm b/test/disk_tests/usages/sda_udevadm
new file mode 100644
index 0000000..ab04390
--- /dev/null
+++ b/test/disk_tests/usages/sda_udevadm
@@ -0,0 +1,12 @@
+E: DEVNAME=/dev/sda
+E: DEVTYPE=disk
+E: ID_ATA_ROTATION_RATE_RPM=0
+E: ID_BUS=ata
+E: ID_MODEL=MODEL1
+E: ID_PART_TABLE_TYPE=gpt
+E: ID_PART_TABLE_UUID=8417b93f-eff9-4e8f-8d84-dc2e77fc07a2
+E: ID_SERIAL=SERIAL1
+E: ID_SERIAL_SHORT=SERIAL1
+E: ID_TYPE=disk
+E: ID_WWN=0x0000000000000000
+E: ID_WWN_WITH_EXTENSION=0x0000000000000000
diff --git a/test/disk_tests/usages/sdb/device/vendor b/test/disk_tests/usages/sdb/device/vendor
new file mode 100644
index 0000000..531030d
--- /dev/null
+++ b/test/disk_tests/usages/sdb/device/vendor
@@ -0,0 +1 @@
+ATA
diff --git a/test/disk_tests/usages/sdb/queue/rotational b/test/disk_tests/usages/sdb/queue/rotational
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/disk_tests/usages/sdb/queue/rotational
@@ -0,0 +1 @@
+1
diff --git a/test/disk_tests/usages/sdb/size b/test/disk_tests/usages/sdb/size
new file mode 100644
index 0000000..13de30f
--- /dev/null
+++ b/test/disk_tests/usages/sdb/size
@@ -0,0 +1 @@
+3000
diff --git a/test/disk_tests/usages/sdb_udevadm b/test/disk_tests/usages/sdb_udevadm
new file mode 100644
index 0000000..ada1ca8
--- /dev/null
+++ b/test/disk_tests/usages/sdb_udevadm
@@ -0,0 +1,12 @@
+E: DEVNAME=/dev/sdb
+E: DEVTYPE=disk
+E: ID_ATA_ROTATION_RATE_RPM=0
+E: ID_BUS=ata
+E: ID_MODEL=MODEL1
+E: ID_PART_TABLE_TYPE=gpt
+E: ID_PART_TABLE_UUID=8417b93f-eff9-4e8f-8d84-dc2e77fc07a2
+E: ID_SERIAL=SERIAL1
+E: ID_SERIAL_SHORT=SERIAL1
+E: ID_TYPE=disk
+E: ID_WWN=0x0000000000000000
+E: ID_WWN_WITH_EXTENSION=0x0000000000000000
diff --git a/test/disk_tests/usages/sdc/device/vendor b/test/disk_tests/usages/sdc/device/vendor
new file mode 100644
index 0000000..531030d
--- /dev/null
+++ b/test/disk_tests/usages/sdc/device/vendor
@@ -0,0 +1 @@
+ATA
diff --git a/test/disk_tests/usages/sdc/queue/rotational b/test/disk_tests/usages/sdc/queue/rotational
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/disk_tests/usages/sdc/queue/rotational
@@ -0,0 +1 @@
+1
diff --git a/test/disk_tests/usages/sdc/size b/test/disk_tests/usages/sdc/size
new file mode 100644
index 0000000..13de30f
--- /dev/null
+++ b/test/disk_tests/usages/sdc/size
@@ -0,0 +1 @@
+3000
diff --git a/test/disk_tests/usages/sdc_udevadm b/test/disk_tests/usages/sdc_udevadm
new file mode 100644
index 0000000..42845f3
--- /dev/null
+++ b/test/disk_tests/usages/sdc_udevadm
@@ -0,0 +1,12 @@
+E: DEVNAME=/dev/sdc
+E: DEVTYPE=disk
+E: ID_ATA_ROTATION_RATE_RPM=0
+E: ID_BUS=ata
+E: ID_MODEL=MODEL1
+E: ID_PART_TABLE_TYPE=gpt
+E: ID_PART_TABLE_UUID=8417b93f-eff9-4e8f-8d84-dc2e77fc07a2
+E: ID_SERIAL=SERIAL1
+E: ID_SERIAL_SHORT=SERIAL1
+E: ID_TYPE=disk
+E: ID_WWN=0x0000000000000000
+E: ID_WWN_WITH_EXTENSION=0x0000000000000000
diff --git a/test/disk_tests/usages/sdd/device/vendor b/test/disk_tests/usages/sdd/device/vendor
new file mode 100644
index 0000000..531030d
--- /dev/null
+++ b/test/disk_tests/usages/sdd/device/vendor
@@ -0,0 +1 @@
+ATA
diff --git a/test/disk_tests/usages/sdd/queue/rotational b/test/disk_tests/usages/sdd/queue/rotational
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/disk_tests/usages/sdd/queue/rotational
@@ -0,0 +1 @@
+1
diff --git a/test/disk_tests/usages/sdd/size b/test/disk_tests/usages/sdd/size
new file mode 100644
index 0000000..13de30f
--- /dev/null
+++ b/test/disk_tests/usages/sdd/size
@@ -0,0 +1 @@
+3000
diff --git a/test/disk_tests/usages/sdd_udevadm b/test/disk_tests/usages/sdd_udevadm
new file mode 100644
index 0000000..65e880f
--- /dev/null
+++ b/test/disk_tests/usages/sdd_udevadm
@@ -0,0 +1,12 @@
+E: DEVNAME=/dev/sdd
+E: DEVTYPE=disk
+E: ID_ATA_ROTATION_RATE_RPM=0
+E: ID_BUS=ata
+E: ID_MODEL=MODEL1
+E: ID_PART_TABLE_TYPE=gpt
+E: ID_PART_TABLE_UUID=8417b93f-eff9-4e8f-8d84-dc2e77fc07a2
+E: ID_SERIAL=SERIAL1
+E: ID_SERIAL_SHORT=SERIAL1
+E: ID_TYPE=disk
+E: ID_WWN=0x0000000000000000
+E: ID_WWN_WITH_EXTENSION=0x0000000000000000
diff --git a/test/disk_tests/usages/sde/device/vendor b/test/disk_tests/usages/sde/device/vendor
new file mode 100644
index 0000000..531030d
--- /dev/null
+++ b/test/disk_tests/usages/sde/device/vendor
@@ -0,0 +1 @@
+ATA
diff --git a/test/disk_tests/usages/sde/queue/rotational b/test/disk_tests/usages/sde/queue/rotational
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/disk_tests/usages/sde/queue/rotational
@@ -0,0 +1 @@
+1
diff --git a/test/disk_tests/usages/sde/size b/test/disk_tests/usages/sde/size
new file mode 100644
index 0000000..13de30f
--- /dev/null
+++ b/test/disk_tests/usages/sde/size
@@ -0,0 +1 @@
+3000
diff --git a/test/disk_tests/usages/sde_udevadm b/test/disk_tests/usages/sde_udevadm
new file mode 100644
index 0000000..db77725
--- /dev/null
+++ b/test/disk_tests/usages/sde_udevadm
@@ -0,0 +1,12 @@
+E: DEVNAME=/dev/sde
+E: DEVTYPE=disk
+E: ID_ATA_ROTATION_RATE_RPM=0
+E: ID_BUS=ata
+E: ID_MODEL=MODEL1
+E: ID_PART_TABLE_TYPE=gpt
+E: ID_PART_TABLE_UUID=8417b93f-eff9-4e8f-8d84-dc2e77fc07a2
+E: ID_SERIAL=SERIAL1
+E: ID_SERIAL_SHORT=SERIAL1
+E: ID_TYPE=disk
+E: ID_WWN=0x0000000000000000
+E: ID_WWN_WITH_EXTENSION=0x0000000000000000
diff --git a/test/disk_tests/usages/sdf/device/vendor b/test/disk_tests/usages/sdf/device/vendor
new file mode 100644
index 0000000..531030d
--- /dev/null
+++ b/test/disk_tests/usages/sdf/device/vendor
@@ -0,0 +1 @@
+ATA
diff --git a/test/disk_tests/usages/sdf/queue/rotational b/test/disk_tests/usages/sdf/queue/rotational
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/disk_tests/usages/sdf/queue/rotational
@@ -0,0 +1 @@
+1
diff --git a/test/disk_tests/usages/sdf/size b/test/disk_tests/usages/sdf/size
new file mode 100644
index 0000000..13de30f
--- /dev/null
+++ b/test/disk_tests/usages/sdf/size
@@ -0,0 +1 @@
+3000
diff --git a/test/disk_tests/usages/sdf_udevadm b/test/disk_tests/usages/sdf_udevadm
new file mode 100644
index 0000000..ad49acf
--- /dev/null
+++ b/test/disk_tests/usages/sdf_udevadm
@@ -0,0 +1,12 @@
+E: DEVNAME=/dev/sdf
+E: DEVTYPE=disk
+E: ID_ATA_ROTATION_RATE_RPM=0
+E: ID_BUS=ata
+E: ID_MODEL=MODEL1
+E: ID_PART_TABLE_TYPE=gpt
+E: ID_PART_TABLE_UUID=8417b93f-eff9-4e8f-8d84-dc2e77fc07a2
+E: ID_SERIAL=SERIAL1
+E: ID_SERIAL_SHORT=SERIAL1
+E: ID_TYPE=disk
+E: ID_WWN=0x0000000000000000
+E: ID_WWN_WITH_EXTENSION=0x0000000000000000
diff --git a/test/disk_tests/usages/zpool b/test/disk_tests/usages/zpool
new file mode 100644
index 0000000..3431792
--- /dev/null
+++ b/test/disk_tests/usages/zpool
@@ -0,0 +1,6 @@
+testpool	2.00T	1.00T	2.60T	-	5%	28%	1.00x	ONLINE	-
+	/dev/sdc	3.62T	1.02T	2.60T	-	5%	28%
+log      -      -      -         -      -      -
+	/dev/sdd1	15.9G	2.79M	15.9G	-	82%	0%
+cache      -      -      -         -      -      -
+	/dev/sdd2	42.5G	36.2G	6.36G	-	0%	85%
-- 
2.1.4





More information about the pve-devel mailing list