From: Ralph Boehme Date: Thu, 11 Mar 2021 13:46:28 +0000 (+0100) Subject: selftest: add a test for %U variable expansion in spoolssd X-Git-Tag: tevent-0.11.0~1558 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7662a77c4cb473c431386c9b8014e846bc5e5882;p=thirdparty%2Fsamba.git selftest: add a test for %U variable expansion in spoolssd This targets the nt4_dc testenv which luckily already runs with spoolssd enabled. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14668 MR: https://gitlab.com/samba-team/samba/-/merge_requests/1834 Signed-off-by: Ralph Boehme Reviewed-by: Björn Baumbach Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail.d/samba3.blackbox.printing_var_exp b/selftest/knownfail.d/samba3.blackbox.printing_var_exp new file mode 100644 index 00000000000..5312a586514 --- /dev/null +++ b/selftest/knownfail.d/samba3.blackbox.printing_var_exp @@ -0,0 +1 @@ +^samba3.blackbox.printing_var_exp.Test variable expansion.* diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index a0c43aa842e..48ca3bf4688 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -2490,6 +2490,11 @@ sub provision($$) [print3] copy = print1 default devmode = no + +[print_var_exp] + copy = print1 + print command = $self->{srcdir}/source3/script/tests/printing/printing_var_exp_lpr_cmd.sh \"Windows user: %U\" \"UNIX user: %u\" \"Domain: %D\" + [lp] copy = print1 diff --git a/source3/script/tests/printing/printing_var_exp_lpr_cmd.sh b/source3/script/tests/printing/printing_var_exp_lpr_cmd.sh new file mode 100755 index 00000000000..4a56a15eb94 --- /dev/null +++ b/source3/script/tests/printing/printing_var_exp_lpr_cmd.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +rm -f /tmp/printing_var_exp.log + +for i in $(seq 1 $#) ; do + eval echo "arg $i: \$$i" >> /tmp/printing_var_exp.log +done diff --git a/source3/script/tests/test_printing_var_exp.sh b/source3/script/tests/test_printing_var_exp.sh new file mode 100755 index 00000000000..6cfd6c00f29 --- /dev/null +++ b/source3/script/tests/test_printing_var_exp.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +if [ $# -lt 4 ]; then +cat <