Blame SOURCES/0013-tests-monitor-Support-running-individual-test-cases.patch

3730f4
From 67f168ebfbeb26a8d7e4f1b9284cc32f13ceff9b Mon Sep 17 00:00:00 2001
3730f4
From: Phil Sutter <psutter@redhat.com>
3730f4
Date: Wed, 12 Feb 2020 22:35:27 +0100
3730f4
Subject: [PATCH] tests: monitor: Support running individual test cases
3730f4
3730f4
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1754047
3730f4
Upstream Status: nftables commit eb5034108cdc6
3730f4
3730f4
commit eb5034108cdc60341b2d61599077db935b6bbc4f
3730f4
Author: Phil Sutter <phil@nwl.cc>
3730f4
Date:   Fri Jan 10 11:15:45 2020 +0100
3730f4
3730f4
    tests: monitor: Support running individual test cases
3730f4
3730f4
    Recognize testcase paths on command line and limit testing on those
3730f4
    only.
3730f4
3730f4
    Signed-off-by: Phil Sutter <phil@nwl.cc>
3730f4
    Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
3730f4
---
3730f4
 tests/monitor/run-tests.sh | 9 +++++++--
3730f4
 1 file changed, 7 insertions(+), 2 deletions(-)
3730f4
3730f4
diff --git a/tests/monitor/run-tests.sh b/tests/monitor/run-tests.sh
3730f4
index 0478cf6..efacdaa 100755
3730f4
--- a/tests/monitor/run-tests.sh
3730f4
+++ b/tests/monitor/run-tests.sh
3730f4
@@ -108,6 +108,7 @@ echo_run_test() {
3730f4
 	touch $output_file
3730f4
 }
3730f4
 
3730f4
+testcases=""
3730f4
 while [ -n "$1" ]; do
3730f4
 	case "$1" in
3730f4
 	-d|--debug)
3730f4
@@ -118,11 +119,15 @@ while [ -n "$1" ]; do
3730f4
 		test_json=true
3730f4
 		shift
3730f4
 		;;
3730f4
+	testcases/*.t)
3730f4
+		testcases+=" $1"
3730f4
+		shift
3730f4
+		;;
3730f4
 	*)
3730f4
 		echo "unknown option '$1'"
3730f4
 		;&
3730f4
 	-h|--help)
3730f4
-		echo "Usage: $(basename $0) [-j|--json] [-d|--debug]"
3730f4
+		echo "Usage: $(basename $0) [-j|--json] [-d|--debug] [testcase ...]"
3730f4
 		exit 1
3730f4
 		;;
3730f4
 	esac
3730f4
@@ -138,7 +143,7 @@ for variant in $variants; do
3730f4
 	run_test=${variant}_run_test
3730f4
 	output_append=${variant}_output_append
3730f4
 
3730f4
-	for testcase in testcases/*.t; do
3730f4
+	for testcase in ${testcases:-testcases/*.t}; do
3730f4
 		echo "$variant: running tests from file $(basename $testcase)"
3730f4
 		# files are like this:
3730f4
 		#
3730f4
-- 
252916
2.31.1
3730f4