From 5a8066e48830e8ed74140a6f5a85f0f2c870d4e9 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 27 Nov 2017 14:39:24 -0500 Subject: [PATCH] Enhance the testing case for rspconfig setting hostname --- .../testcase/UT_openbmc/rspconfig_cases0 | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 index f9a34c5c6..a1d4c4925 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 @@ -34,29 +34,38 @@ check:rc==1 check:output=~Error: Can not set and query OpenBMC information at the same time end -start:rspconfig_set_hostname -description: Check that we can set the hostname on the BMC +start:rspconfig_get_and_set_hostname +description: Test setting and getting hostname on the BMC os:Linux hcp:openbmc -cmd:rspconfig $$CN hostname=$$CN-UTset +# Save the hostname to a file.... +cmd:rspconfig $$CN hostname | tee /tmp/xcattest.rspconfig.hostname +check:rc==0 +check:output=~$$CN: BMC Hostname: +# Set to witherspoon first +cmd:rspconfig $$CN hostname=witherspoon +check:rc==0 +check:output=~$$CN: BMC Setting Hostname... +# Check that it's set to witherspoon +cmd:rspconfig $$CN hostname +check:rc==0 +check:output=~$$CN: BMC Hostname: witherspoon +# Set to -UTset +cmd:rspconfig $$CN hostname=$$CN-UTset +check:rc==0 +check:output=~$$CN: BMC Setting Hostname... +# Check that it's set +cmd:rspconfig $$CN hostname check:rc==0 check:output=~$$CN: BMC Hostname: $$CN-UTset -end - -start:rspconfig_set_hostname_check -description: Check that the value is correct on the BMC -os:Linux -hcp:openbmc -cmd:rspconfig $$CN hostname +# Restore to saved version +cmd:grep BMC /tmp/xcattest.rspconfig.hostname | cut -d' ' -f4 | xargs -i{} rspconfig $$CN hostname={} +check:rc==0 +check:output=~$$CN: BMC Setting Hostname... +cmd:rspconfig $$CN hostname +check:rc==0 +check:output=~$$CN: BMC Hostname: +cmd:rm /tmp/xcattest.rspconfig.hostname check:rc==0 -check:output=~$$CN: BMC Hostname: $$CN-UTset end -start:rspconfig_set_hostname -description: Check that we can set the hostname on the BMC -os:Linux -hcp:openbmc -cmd:rspconfig $$CN hostname=witherspoon -check:rc==0 -check:output=~$$CN: BMC Hostname: witherspoon -end