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

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