Enable system configuration validation by default.
Fixes:
- By default, enable inventory check in HTX hardbootme test.
- Rename the JSON and yaml files generated.
- Users can choose inventory file names using
PREV_INV_FILE_PATH variable.
Resolves openbmc/openc-test-automation#825
Change-Id: I215d210b28347bffa117d26ed001b825c19aea9e
Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
diff --git a/syslib/utils_os.robot b/syslib/utils_os.robot
index 0c62124..44521b4 100755
--- a/syslib/utils_os.robot
+++ b/syslib/utils_os.robot
@@ -26,8 +26,8 @@
... network printer tape
# Inventory Paths of the JSON and YAML files
-${json_tmp_file_path} ${EXECDIR}/inventory.json
-${yaml_file_path} ${EXECDIR}/inventory.yaml
+${json_tmp_file_path} ${EXECDIR}/inventory_temp_file.json
+${yaml_file_path} ${EXECDIR}/inventory_temp_file.yaml
diff --git a/systest/htx_hardbootme_test.robot b/systest/htx_hardbootme_test.robot
index be2d920..4f22f59 100755
--- a/systest/htx_hardbootme_test.robot
+++ b/systest/htx_hardbootme_test.robot
@@ -16,14 +16,16 @@
# $HTX_LOOP times checking every $HTX_INTERVAL.
# HTX_KEEP_RUNNING If set to 1, this indicates that the HTX is to
# continue running after an error.
-# CHECK_INVENTORY If set to 1, this enables OS inventory checking
-# before and after each HTX run. This parameter
-# is optional.
-# PREV_INV_FILE_PATH The file path and name of a previous inventory
-# snapshot file. After HTX start the system inventory
-# is compared to the contents of this file. Setting this
-# parameter is optional. CHECK_INVENTORY does not
-# need to be set if PREV_INV_FILE_PATH is set.
+# CHECK_INVENTORY If set to 0 or False, OS inventory checking before
+# and after each HTX run will be disabled. This
+# parameter is optional.
+# PREV_INV_FILE_PATH The file path and name of an initial previous
+# inventory snapshot file in JSON format. Inventory
+# snapshots taken before and after each HTX run will
+# be compared to this file.
+# This parameter is optional. If not specified, an
+# initial inventory snapshot will be taken before
+# HTX startup.
Resource ../syslib/utils_os.robot
Library ../syslib/utils_keywords.py
@@ -39,7 +41,7 @@
${json_final_file_path} ${EXECDIR}/data/os_inventory_final.json
${json_diff_file_path} ${EXECDIR}/data/os_inventory_diff.json
${last_inventory_file_path} ${EMPTY}
-${run_the_inventory} 0
+${CHECK_INVENTORY} True
&{ignore_dict} processor=size
*** Test Cases ***
@@ -51,19 +53,11 @@
Rprintn
Rpvars HTX_DURATION HTX_INTERVAL
- # Set last inventory file to PREV_INV_FILE_PATH otherwise set
- # it to ${EMPTY}.
+ # Set last inventory file to PREV_INV_FILE_PATH otherwise set it
+ # to ${EMPTY}.
${last_inventory_file_path}= Get Variable Value ${PREV_INV_FILE_PATH}
... ${EMPTY}
- # Set ${run_the_inventory} if PREV_INV_FILE_PATH was specified,
- # else set ${run_the_inventory} from the ${CHECK_INVENTORY} parameter.
- ${run_the_inventory}= Run Keyword If
- ... '${last_inventory_file_path}' != '${EMPTY}' Set Variable ${1}
- ... ELSE Run Keyword If '${last_inventory_file_path}' == '${EMPTY}'
- ... Get Variable Value ${CHECK_INVENTORY} ${EMPTY}
-
- Set Suite Variable ${run_the_inventory} children=true
Set Suite Variable ${last_inventory_file_path} children=true
Repeat Keyword ${HTX_LOOP} times Run HTX Exerciser
@@ -90,7 +84,7 @@
# Post Power off and on, the OS SSH session needs to be established.
Login To OS
- Run Keyword If '${run_the_inventory}' != '${EMPTY}'
+ Run Keyword If '${CHECK_INVENTORY}' == 'True'
... Do Inventory And Compare ${json_initial_file_path}
... ${last_inventory_file_path}
@@ -103,7 +97,7 @@
Shutdown HTX Exerciser
- Run Keyword If '${run_the_inventory}' != '${EMPTY}'
+ Run Keyword If '${CHECK_INVENTORY}' == 'True'
... Do Inventory And Compare ${json_final_file_path}
... ${last_inventory_file_path}
@@ -116,7 +110,7 @@
Rprint Timen HTX Test ran for: ${HTX_DURATION}
-Do Inventory and Compare
+Do Inventory And Compare
[Documentation] Do inventory and compare.
[Arguments] ${inventory_file_path} ${last_inventory_file_path}
# Description of argument(s):