From ea5296b3060c483f6b0d707de662c1eed8be4585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sedl=C3=A1k?= Date: Tue, 9 May 2017 09:11:34 +0200 Subject: [PATCH] add postinstalls to custom partitioning tests Differential Revision: https://phab.qa.fedoraproject.org/D1192 --- templates | 4 ++++ tests/disk_custom_btrfs_postinstall.pm | 17 +++++++++++++++++ tests/disk_custom_ext3_postinstall.pm | 17 +++++++++++++++++ tests/disk_custom_lvmthin_postinstall.pm | 19 +++++++++++++++++++ tests/disk_custom_no_swap_postinstall.pm | 17 +++++++++++++++++ .../disk_custom_software_raid_postinstall.pm | 2 +- tests/disk_custom_xfs_postinstall.pm | 17 +++++++++++++++++ 7 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tests/disk_custom_btrfs_postinstall.pm create mode 100644 tests/disk_custom_ext3_postinstall.pm create mode 100644 tests/disk_custom_lvmthin_postinstall.pm create mode 100644 tests/disk_custom_no_swap_postinstall.pm create mode 100644 tests/disk_custom_xfs_postinstall.pm diff --git a/templates b/templates index 5122545a..55dfbb48 100755 --- a/templates +++ b/templates @@ -1990,6 +1990,7 @@ name => "install_blivet_ext3", settings => [ { key => "PARTITIONING", value => "custom_blivet_ext3" }, + { key => "POSTINSTALL", value => "disk_custom_ext3_postinstall" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, ], }, @@ -1997,6 +1998,7 @@ name => "install_blivet_no_swap", settings => [ { key => "PARTITIONING", value => "custom_blivet_no_swap" }, + { key => "POSTINSTALL", value => "disk_custom_no_swap_postinstall" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, ], }, @@ -2004,6 +2006,7 @@ name => "install_blivet_xfs", settings => [ { key => "PARTITIONING", value => "custom_blivet_xfs" }, + { key => "POSTINSTALL", value => "disk_custom_xfs_postinstall" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, ], }, @@ -2020,6 +2023,7 @@ name => "install_blivet_lvmthin", settings => [ { key => "PARTITIONING", value => "custom_blivet_lvmthin" }, + { key => "POSTINSTALL", value => "disk_custom_lvmthin_postinstall" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, ], }, diff --git a/tests/disk_custom_btrfs_postinstall.pm b/tests/disk_custom_btrfs_postinstall.pm new file mode 100644 index 00000000..a41be641 --- /dev/null +++ b/tests/disk_custom_btrfs_postinstall.pm @@ -0,0 +1,17 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + # check that btrfs is used on root partition + assert_script_run "mount | grep 'on / type btrfs'"; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_ext3_postinstall.pm b/tests/disk_custom_ext3_postinstall.pm new file mode 100644 index 00000000..7171cc2a --- /dev/null +++ b/tests/disk_custom_ext3_postinstall.pm @@ -0,0 +1,17 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + # check that ext3 is used on root partition + assert_script_run "mount | grep 'on / type ext3'"; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_lvmthin_postinstall.pm b/tests/disk_custom_lvmthin_postinstall.pm new file mode 100644 index 00000000..1f2d4c25 --- /dev/null +++ b/tests/disk_custom_lvmthin_postinstall.pm @@ -0,0 +1,19 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + # check that lvmthinpool is present: + # http://atodorov.org/blog/2015/04/14/how-to-find-if-lvm-volume-is-thinly-provisioned/ + # arguments of thinpool devices has T, t or V at the beginning of attributes + assert_script_run "lvs -o lv_attr | grep -E '^[[:space:]]*(T|t|V)'"; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_no_swap_postinstall.pm b/tests/disk_custom_no_swap_postinstall.pm new file mode 100644 index 00000000..6cdd75e1 --- /dev/null +++ b/tests/disk_custom_no_swap_postinstall.pm @@ -0,0 +1,17 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + # check that swap is not used, check that "swapon --show has empty input" + assert_script_run '[[ ! $(swapon --show) ]]'; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/disk_custom_software_raid_postinstall.pm b/tests/disk_custom_software_raid_postinstall.pm index 29319dda..6cff869e 100644 --- a/tests/disk_custom_software_raid_postinstall.pm +++ b/tests/disk_custom_software_raid_postinstall.pm @@ -5,7 +5,7 @@ use testapi; sub run { assert_screen "root_console"; # check that RAID is used - validate_script_output "cat /proc/mdstat", sub { $_ =~ m/Personalities : \[raid1\]/ }; + assert_script_run "cat /proc/mdstat | grep 'Personalities : \\\[raid1\\\]'"; } sub test_flags { diff --git a/tests/disk_custom_xfs_postinstall.pm b/tests/disk_custom_xfs_postinstall.pm new file mode 100644 index 00000000..02b73e24 --- /dev/null +++ b/tests/disk_custom_xfs_postinstall.pm @@ -0,0 +1,17 @@ +use base "installedtest"; +use strict; +use testapi; + +sub run { + assert_screen "root_console"; + # check that xfs is used on root partition + assert_script_run "mount | grep 'on / type xfs'"; +} + +sub test_flags { + return { fatal => 1 }; +} + +1; + +# vim: set sw=4 et: