Remove unnesessary fix for testr
As far community replace testr on stestr in tempest 18
we should remove fix for testr skip mechanism and replace in
run-tempest.sh call of testr on stestr
Change-Id: I0864da097e29273142393ba55f88c1346c222573
Related-Prod: PROD-22874 PROD-23315
diff --git a/bin/patches/regex_builder.patch b/bin/patches/regex_builder.patch
deleted file mode 100644
index b29bf4a..0000000
--- a/bin/patches/regex_builder.patch
+++ /dev/null
@@ -1,77 +0,0 @@
---- os_testr/regex_builder.py 2018-04-25 11:33:36.330640993 +0300
-+++ os_testr/regex_builder.py 2018-04-25 11:33:54.878627168 +0300
-@@ -71,34 +71,46 @@
- return '|'.join(lines)
-
-
--def construct_regex(blacklist_file, whitelist_file, regex, print_exclude):
-- """Deprecated, please use testlist_builder.construct_list instead."""
-- if not blacklist_file:
-+def get_regex_from_blacklist_file(file_path, print_exclude=False):
-+ exclude_regex = ''
-+ with open(file_path, 'r') as black_file:
- exclude_regex = ''
-- else:
-- with open(blacklist_file, 'r') as black_file:
-- exclude_regex = ''
-- for line in black_file:
-- raw_line = line.strip()
-- split_line = raw_line.split('#')
-- # Before the # is the regex
-- line_regex = split_line[0].strip()
-- if len(split_line) > 1:
-- # After the # is a comment
-- comment = split_line[1].strip()
-+ for line in black_file:
-+ raw_line = line.strip()
-+ split_line = raw_line.split('#')
-+ # Before the # is the regex
-+ line_regex = split_line[0].strip()
-+ if len(split_line) > 1:
-+ # After the # is a comment
-+ comment = split_line[1].strip()
-+ else:
-+ comment = ''
-+ if line_regex:
-+ if print_exclude:
-+ print_skips(line_regex, comment)
-+ if exclude_regex:
-+ exclude_regex = '|'.join([line_regex, exclude_regex])
- else:
-- comment = ''
-- if line_regex:
-- if print_exclude:
-- print_skips(line_regex, comment)
-- if exclude_regex:
-- exclude_regex = '|'.join([line_regex, exclude_regex])
-- else:
-- exclude_regex = line_regex
-- if exclude_regex:
-- exclude_regex = "^((?!" + exclude_regex + ").)*$"
-- if regex:
-- exclude_regex += regex
-- if whitelist_file:
-- exclude_regex += '%s' % get_regex_from_whitelist_file(whitelist_file)
-+ exclude_regex = line_regex
-+ if exclude_regex:
-+ exclude_regex = "(?!" + exclude_regex + ")"
- return exclude_regex
-+
-+
-+def construct_regex(blacklist_file, whitelist_file, regex, print_exclude):
-+ """Deprecated, please use testlist_builder.construct_list instead."""
-+ bregex = ''
-+ wregex = ''
-+ pregex = ''
-+
-+ if blacklist_file:
-+ bregex = get_regex_from_blacklist_file(blacklist_file, print_exclude)
-+ if whitelist_file:
-+ wregex = get_regex_from_whitelist_file(whitelist_file)
-+ if regex:
-+ pregex = regex
-+ combined_regex = '^%s.*(%s).*$' % (bregex, '|'.join(
-+ filter(None, [pregex, wregex])
-+ ))
-+
-+ return combined_regex
diff --git a/bin/run_tempest.sh b/bin/run_tempest.sh
index 2ddde95..cdbacc1 100755
--- a/bin/run_tempest.sh
+++ b/bin/run_tempest.sh
@@ -28,5 +28,5 @@
tempest run $ARGS | tee -a ${log}
if [[ "$ARGS" =~ '-r ' || "$ARGS" =~ '--regex' || "$ARGS" =~ '-s' || "$ARGS" =~ '--smoke' || "$ARGS" =~ '--blacklist-file' || "$ARGS" =~ '-w' || "$ARGS" == '' ]]; then
- testr last --subunit | subunit2junitxml > $LOG_DIR/$report.xml || true
+ stestr last --subunit | subunit2junitxml > $LOG_DIR/$report.xml || true
fi