summaryrefslogtreecommitdiffstats
path: root/scripts/lib/resulttool/manualexecution.py
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2019-03-07 12:49:08 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-26 15:38:23 +0000
commit10502961503e56d8c703bd442ee3071199e683ce (patch)
treeaa463903ff9bca73d5b47693c6f389c465728b1b /scripts/lib/resulttool/manualexecution.py
parentb6fa6f7e6c7305a9a664d39724ffb4076929a0a5 (diff)
downloadpoky-10502961503e56d8c703bd442ee3071199e683ce.tar.gz
scripts/resulttool: Enable manual result store and regression
To enable store for testresults.json file from manualexecution, add layers metadata to configuration and add "manual" map to resultutils.store_map. To enable regression for manual, add "manual" map to resultutils.regression_map. Also added compulsory configurations ('MACHINE', 'IMAGE_BASENAME') to manualexecution. (From OE-Core rev: 3e711cd0482e9df644b011a7d6dadffdfe139f8e) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/resulttool/manualexecution.py')
-rwxr-xr-xscripts/lib/resulttool/manualexecution.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/scripts/lib/resulttool/manualexecution.py b/scripts/lib/resulttool/manualexecution.py
index ecdc4e7a7a..a44cc86190 100755
--- a/scripts/lib/resulttool/manualexecution.py
+++ b/scripts/lib/resulttool/manualexecution.py
@@ -19,6 +19,7 @@ import datetime
19import re 19import re
20from oeqa.core.runner import OETestResultJSONHelper 20from oeqa.core.runner import OETestResultJSONHelper
21 21
22
22def load_json_file(file): 23def load_json_file(file):
23 with open(file, "r") as f: 24 with open(file, "r") as f:
24 return json.load(f) 25 return json.load(f)
@@ -46,31 +47,34 @@ class ManualTestRunner(object):
46 def _get_input(self, config): 47 def _get_input(self, config):
47 while True: 48 while True:
48 output = input('{} = '.format(config)) 49 output = input('{} = '.format(config))
49 if re.match('^[a-zA-Z0-9_]+$', output): 50 if re.match('^[a-zA-Z0-9_-]+$', output):
50 break 51 break
51 print('Only alphanumeric and underscore are allowed. Please try again') 52 print('Only alphanumeric and underscore/hyphen are allowed. Please try again')
52 return output 53 return output
53 54
54 def _create_config(self): 55 def _create_config(self):
56 from oeqa.utils.metadata import get_layers
57 from oeqa.utils.commands import get_bb_var
58 from resulttool.resultutils import store_map
59
60 layers = get_layers(get_bb_var('BBLAYERS'))
55 self.configuration = {} 61 self.configuration = {}
56 while True: 62 self.configuration['LAYERS'] = layers
57 try: 63 current_datetime = datetime.datetime.now()
58 conf_total = int(input('\nPlease provide how many configuration you want to save \n')) 64 self.starttime = current_datetime.strftime('%Y%m%d%H%M%S')
59 break 65 self.configuration['STARTTIME'] = self.starttime
60 except ValueError: 66 self.configuration['TEST_TYPE'] = 'manual'
61 print('Invalid input. Please provide input as a number not character.') 67 self.configuration['TEST_MODULE'] = self.test_module
62 for i in range(conf_total): 68
69 extra_config = set(store_map['manual']) - set(self.configuration)
70 for config in sorted(extra_config):
63 print('---------------------------------------------') 71 print('---------------------------------------------')
64 print('This is configuration #%s ' % (i + 1) + '. Please provide configuration name and its value') 72 print('This is configuration #%s. Please provide configuration value(use "None" if not applicable).'
73 % config)
65 print('---------------------------------------------') 74 print('---------------------------------------------')
66 name_conf = self._get_input('Configuration Name')
67 value_conf = self._get_input('Configuration Value') 75 value_conf = self._get_input('Configuration Value')
68 print('---------------------------------------------\n') 76 print('---------------------------------------------\n')
69 self.configuration[name_conf.upper()] = value_conf 77 self.configuration[config] = value_conf
70 current_datetime = datetime.datetime.now()
71 self.starttime = current_datetime.strftime('%Y%m%d%H%M%S')
72 self.configuration['STARTTIME'] = self.starttime
73 self.configuration['TEST_TYPE'] = self.test_module
74 78
75 def _create_result_id(self): 79 def _create_result_id(self):
76 self.result_id = 'manual_' + self.test_module + '_' + self.starttime 80 self.result_id = 'manual_' + self.test_module + '_' + self.starttime