From fa49851d1c214fab9e54d065468503e04e0c9963 Mon Sep 17 00:00:00 2001 From: Narasimhan V Date: Tue, 21 Apr 2020 21:21:20 +0530 Subject: [PATCH] Making norun_tests env_types combinations robust Earlier, we were looking for only specific permutations of norun_tests combinations. Now, it is more robust by using permutations. Signed-off-by: Narasimhan V --- avocado-setup.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/avocado-setup.py b/avocado-setup.py index fc59795..ba76e01 100755 --- a/avocado-setup.py +++ b/avocado-setup.py @@ -23,6 +23,7 @@ import argparse import configparser import binascii +from itertools import permutations from shutil import copyfile from lib.logger import logger_init @@ -443,14 +444,18 @@ def parse_test_config(test_config_file, avocado_bin, enable_kvm): (env_ver, env_type, cmdpat) = helper.get_env_type(enable_kvm) norun_tests = [] # Get common set of not needed tests - env = 'norun_%s' % env_type - dist = 'norun_%s' % helper.get_dist()[0] - major = 'norun_%s' % env_ver.split('.')[0] - minor = 'norun_%s' % env_ver - minor_env = 'norun_%s_%s' % (env_ver, env_type) - for section in [env, dist, major, minor, minor_env]: - if NORUNTESTFILE.has_section(section): - norun_tests.extend(NORUNTESTFILE.get(section, 'tests').split(',')) + dist = helper.get_dist()[0] + major = env_ver.split('.')[0] + minor = env_ver + perm = [] + env_list = [env_type, dist, major, minor] + for length in range(1, len(env_list)): + perm.extend(list(permutations(env_list, length))) + perm = ['norun_%s' % '_'.join(per) for per in perm] + for per in perm: + print(per) + if NORUNTESTFILE.has_section(per): + norun_tests.extend(NORUNTESTFILE.get(per, 'tests').split(',')) norun_tests = list(filter(None, norun_tests)) with open(test_config_file, 'r') as fp: