From be359b1899aefa76d9ddd75bd84b5deaeabd70fe Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 30 Apr 2020 13:58:35 -0400 Subject: [PATCH] Testcase and packimage fixes for squashfs --- xCAT-server/lib/xcat/plugins/packimage.pm | 16 +++++++--------- .../reg_linux_diskless_installation_flat | 9 ++++++--- .../reg_linux_diskless_installation_hierarchy | 9 ++++++--- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 9dbb6f04b..aa783fd86 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -573,15 +573,13 @@ sub process_request { chmod 0644, "$destdir/rootimg.$suffix"; umask $oldmask; } elsif ($method =~ /squashfs/) { - my $flags; - if ($arch =~ /x86/) { - $flags = "-le"; - } elsif ($arch =~ /ppc/) { - $flags = "-be"; - } - - if (($osver =~ /rhels/ && $osver !~ /rhels5/) || ($osver =~ /centos/)) { - $flags = ""; + my $flags = ""; + if ($osver =~ /rhels5/) { + if ($arch =~ /x86/) { + $flags = "-le"; + } elsif ($arch =~ /ppc/) { + $flags = "-be"; + } } if (!-x "/sbin/mksquashfs" && !-x "/usr/bin/mksquashfs") { diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 56d2fdfcc..ab39cd496 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -130,11 +130,14 @@ cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-l check:rc==0 cmd:rm -rf /tmp/mountoutput +#Make sure squashfs-tools rpm is installed on RHEL +cmd:if [ "$$OS" =~ "rhel" ];then yum install -y squashfs-tools; fi + #Make sure squashfs-tools rpm is installed on Ubuntu -cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi +cmd:if [ "$$OS" =~ "ubuntu" ];then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES -cmd:if [ "$$OS" = "sle" ];then zypper install -y squashfs; fi +cmd:if [ "$$OS" =~ "sle" ];then zypper install -y squashfs; fi cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -157,7 +160,7 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 -check:output=~on / type tmpfs +check:output=~on / type overlay cmd:xdsh $$CN cat /opt/xcat/xcatinfo check:rc==0 check:output=~NODE=$$CN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 411c9f37f..7a399e7b0 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -153,11 +153,14 @@ cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netb cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +#Make sure squashfs-tools rpm is installed on RHEL +cmd:if [ "$$OS" =~ "rhel" ];then yum install -y squashfs-tools; fi + #Make sure squashfs-tools rpm is installed on Ubuntu -cmd:if [ "$$OS" = "ubuntu" ];then apt-get install -y squashfs-tools; fi +cmd:if [ "$$OS" =~ "ubuntu" ];then apt-get install -y squashfs-tools; fi #Make sure squashfs rpm is installed on SLES -cmd:if [ "$$OS" = "sle" ];then zypper install -y squashfs; fi +cmd:if [ "$$OS" =~ "sle" ];then zypper install -y squashfs; fi cmd:packimage -m squashfs __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 @@ -185,7 +188,7 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 -check:output=~on / type tmpfs +check:output=~on / type overlay cmd:xdsh $$CN cat /opt/xcat/xcatinfo check:rc==0 check:output=~NODE=$$CN