From 5ebb85a08014a39d78b424072109477766551385 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 26 Oct 2022 10:21:01 -0400 Subject: [PATCH] Better way to check OS in testcase --- xCAT-test/autotest/testcase/go_xcat/case3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 705b24a33..01b58b915 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -62,11 +62,11 @@ check:rc==0 check:output=~running #Verify xCAT public key was installed -cmd:if xdsh $$CN "grep \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "apt-key list"; else xdsh $$CN "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'"; fi +cmd:if [[ "$$OS" =~ "ubuntu" ]]; then xdsh $$CN "apt-key list"; else xdsh $$CN "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'"; fi check:output=~xCAT Automatic Signing Key #Remove public key on non-Ubuntu system. It was installed during go-xcat RPM installs -cmd:if xdsh $$CN "grep -v \"Ubuntu\" /etc/*release >/dev/null"; then xdsh $$CN "rpm -e gpg-pubkey-ca548a47-5b2c830b"; fi +cmd:if [[ "$$OS" !~ "ubuntu" ]]; then xdsh $$CN "rpm -e gpg-pubkey-ca548a47-5b2c830b"; fi cmd:xdsh $$CN "service xcatd stop" end