summaryrefslogtreecommitdiffstats
path: root/source3/script
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2013-06-28 18:36:22 +0200
committerJim McDonough <jmcd@samba.org>2013-11-05 08:42:40 -0500
commit3a10b8803a0e2d4238d01926cb9226d5969852a2 (patch)
tree846e331a4557d01727498228807649c71cf966c9 /source3/script
parentcb0803444a1f932ea1e422984678da6b7948adb6 (diff)
downloadsamba-3a10b8803a0e2d4238d01926cb9226d5969852a2.tar.gz
samba-3a10b8803a0e2d4238d01926cb9226d5969852a2.tar.xz
samba-3a10b8803a0e2d4238d01926cb9226d5969852a2.zip
test_smbclient_tarmode.pl: add option to choose and run a single test
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3/script')
-rwxr-xr-xsource3/script/tests/test_smbclient_tarmode.pl23
1 files changed, 22 insertions, 1 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl
index 1643fb66508..91c11931607 100755
--- a/source3/script/tests/test_smbclient_tarmode.pl
+++ b/source3/script/tests/test_smbclient_tarmode.pl
@@ -50,6 +50,8 @@ our $LOCALPATH = '/media/data/smb-test';
our $TMP = '/tmp/smb-tmp';
our $BIN = 'smbclient';
+our $SINGLE_TEST = -1;
+
our @SMBARGS = ();
our $DEBUG = 0;
@@ -64,6 +66,7 @@ test_smbclient_tarmode.pl [options] -- [smbclient options]
-h, --help brief help message
--man full documentation
+ Environment:
-u, --user USER
-p, --password PW
-h, --host HOST
@@ -81,6 +84,10 @@ test_smbclient_tarmode.pl [options] -- [smbclient options]
-b, --bin BIN
path to the smbclient binary to use
+ Test:
+ --test N
+ only run test number N
+
=cut
GetOptions('u|user=s' => \$USER,
@@ -93,6 +100,8 @@ GetOptions('u|user=s' => \$USER,
't|tmp=s' => \$TMP,
'b|bin=s' => \$BIN,
+ 'test=i' => \$SINGLE_TEST,
+
'debug' => \$DEBUG,
'h|help' => \$HELP,
'man' => \$MAN) or pod2usage(2);
@@ -122,7 +131,7 @@ my $TAR = "$TMP/tarmode.tar";
# RUN TESTS
-run_test(
+my @all_tests = (
[\&test_creation_normal, 'normal'],
[\&test_creation_normal, 'nested'],
[\&test_creation_incremental, '-g'],
@@ -133,6 +142,18 @@ run_test(
[\&test_extraction_normal],
);
+if($SINGLE_TEST == -1) {
+ run_test(@all_tests);
+}
+
+elsif(0 <= $SINGLE_TEST&&$SINGLE_TEST < @all_tests) {
+ run_test($all_tests[$SINGLE_TEST]);
+}
+
+else {
+ die "Test number is invalid\n";
+}
+
#####
# TEST DEFINITIONS