When flag defined in testcase config file like as follows
the casecfgcheck still trys to use flag 'clean' or 'sleep' as
the key to get required_params, optional_params variables.
so it reports 'KeyError' becuase no testcases named 'clean'
or 'sleep' in case_params data format. The patch ignore
the check for these flags.
domain:start
guestname
fedora16
clean
domain:shutdown
guestname
fedora16
sleep 6
domain:destroy
guestname
fedora16
---
casecfgcheck.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/casecfgcheck.py b/casecfgcheck.py
index a88eb74..40d7c6e 100644
--- a/casecfgcheck.py
+++ b/casecfgcheck.py
@@ -33,14 +33,18 @@ class CaseCfgCheck(object):
error_flag = 0
passed_testcase = []
for testcase in self.activity:
- case_number += 1
if testcase in passed_testcase:
continue
testcase_name = testcase.keys()[0]
- actual_params = testcase.values()[0]
+ if testcase_name == 'clean' or \
+ testcase_name == 'sleep':
+ continue
+ actual_params = testcase.values()[0]
required_params, optional_params = self.case_params[testcase_name]
+
+ case_number += 1
ret = self._check_params(required_params, optional_params, actual_params)
if ret:
error_flag = 1
--
1.7.7.5