[PATCHES] some improvements to selftest regarding nss

Michael Adam obnox at samba.org
Fri Feb 13 04:54:27 MST 2015


Hi,

attached find a few patches to selftest.
Mostly nss-related and many of them
preparations for further work on nss
aspects of our selftst currently in preparation.

all except the first two have already been
reviewed.

Review/push appreciated

Michael
-------------- next part --------------
From e2bec7b551bf3c7cc016919e1131dc4d30971233 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sat, 7 Feb 2015 14:32:43 +0100
Subject: [PATCH 1/6] selftest/knownfail: add newline to end of file.

git always complains about what vim does to the file...

Signed-off-by: Michael Adam <obnox at samba.org>
---
 selftest/knownfail | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/selftest/knownfail b/selftest/knownfail
index 5fc05a0..a38fe9f 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -299,4 +299,4 @@
 #
 # Differences in our KDC compared to windows
 #
-^samba4.krb5.kdc .*.as-req-pac-request # We should reply to a request for a PAC over UDP with KRB5KRB_ERR_RESPONSE_TOO_BIG unconditionally
\ No newline at end of file
+^samba4.krb5.kdc .*.as-req-pac-request # We should reply to a request for a PAC over UDP with KRB5KRB_ERR_RESPONSE_TOO_BIG unconditionally
-- 
2.1.0


From f287c7a086b2e087d4e7937e05b9c1346303a2d0 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sat, 7 Feb 2015 12:16:30 +0100
Subject: [PATCH 2/6] selftest: run the samba.nss tests against :local
 environments

Signed-off-by: Michael Adam <obnox at samba.org>
---
 selftest/knownfail        | 2 +-
 source4/selftest/tests.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/selftest/knownfail b/selftest/knownfail
index a38fe9f..b694d06 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -271,7 +271,7 @@
 ^samba.blackbox.wbinfo\(s4member:local\).wbinfo --user-sids against s4member\(s4member:local\)
 ^samba4.winbind.struct.getpwent\(plugin_s4_dc:local\)
 ^samba.wbinfo_simple.\(s4member:local\).--user-groups
-^samba.nss.test using winbind\(s4member\)
+^samba.nss.test using winbind\(s4member:local\)
 #
 # These just happen to fail for some reason (probably because they run against the s4 winbind)
 #
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 00146b8..6086038 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -419,7 +419,7 @@ for env in ["s3dc", "member", "plugin_s4_dc", "dc", "s3member", "s4member"]:
 
 
 nsstest4 = binpath("nsstest")
-for env in ["plugin_s4_dc", "dc", "s4member", "s3dc", "s3member", "member"]:
+for env in ["plugin_s4_dc:local", "dc:local", "s4member:local", "s3dc:local", "s3member:local", "member:local"]:
     if os.path.exists(nsstest4):
         plantestsuite("samba.nss.test using winbind(%s)" % env, env, [os.path.join(bbdir, "nsstest.sh"), nsstest4, os.path.join(samba4bindir, "shared/libnss_wrapper_winbind.so.2")])
     else:
-- 
2.1.0


From c6ed7865c33dd28b8de0a81482b8f236d0e66eb1 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 2 Feb 2015 16:05:17 +0100
Subject: [PATCH 3/6] s4:selftest: avoid creating two entries for UID 0 in
 provision

Pair-Programmed-With: Guenther Deschner <gd at samba.org>

Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
---
 selftest/target/Samba4.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 1cc74b7..13477d7 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -700,10 +700,11 @@ sub provision_raw_step1($$)
 	Samba::mk_krb5_conf($ctx, "");
 
 	open(PWD, ">$ctx->{nsswrap_passwd}");
-	print PWD "
-root:x:0:0:root gecos:$ctx->{prefix_abs}:/bin/false
-$ctx->{unix_name}:x:$ctx->{unix_uid}:100:$ctx->{unix_name} gecos:$ctx->{prefix_abs}:/bin/false
-nobody:x:65534:65533:nobody gecos:$ctx->{prefix_abs}:/bin/false
+	if ($ctx->{unix_uid} != 0) {
+		print PWD "root:x:0:0:root gecos:$ctx->{prefix_abs}:/bin/false\n";
+	}
+	print PWD "$ctx->{unix_name}:x:$ctx->{unix_uid}:100:$ctx->{unix_name} gecos:$ctx->{prefix_abs}:/bin/false\n";
+	print PWD "nobody:x:65534:65533:nobody gecos:$ctx->{prefix_abs}:/bin/false
 pdbtest:x:65533:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
 pdbtest2:x:65532:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
 pdbtest3:x:65531:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
-- 
2.1.0


From 3b969b75a7f48aa65c45ebe36602233c6b018404 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 3 Feb 2015 14:59:06 +0100
Subject: [PATCH 4/6] s4:selftest: avoid creating two groups with GID 0 in
 provision

Pair-Programmed-With: Guenther Deschner <gd at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Guenther Deschner <gd at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
---
 selftest/target/Samba4.pm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 13477d7..a58a1cf 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -714,13 +714,14 @@ pdbtest4:x:65530:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
         my $uid_rfc2307test = 65533;
 
 	open(GRP, ">$ctx->{nsswrap_group}");
-	print GRP "
-root:x:0:
-wheel:x:10:
+	if ($ctx->{unix_gid} != 0) {
+		print GRP "root:x:0:\n";
+	}
+	print GRP "$ctx->{unix_name}:x:$ctx->{unix_gid}:\n";
+	print GRP "wheel:x:10:
 users:x:100:
 nobody:x:65533:
 nogroup:x:65534:nobody
-$ctx->{unix_name}:x:$ctx->{unix_gid}:
 ";
 	close(GRP);
         my $gid_rfc2307test = 65532;
-- 
2.1.0


From 1cd526902ca4afff5a4d4f2d5c740d5154b9195f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Thu, 5 Feb 2015 16:07:35 +0100
Subject: [PATCH 5/6] s4-selftest: push up the "users" gid to make gid
 collision more unlikely.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: G?nther Deschner <gd at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 selftest/target/Samba4.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index a58a1cf..da2009d 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -703,7 +703,7 @@ sub provision_raw_step1($$)
 	if ($ctx->{unix_uid} != 0) {
 		print PWD "root:x:0:0:root gecos:$ctx->{prefix_abs}:/bin/false\n";
 	}
-	print PWD "$ctx->{unix_name}:x:$ctx->{unix_uid}:100:$ctx->{unix_name} gecos:$ctx->{prefix_abs}:/bin/false\n";
+	print PWD "$ctx->{unix_name}:x:$ctx->{unix_uid}:65531:$ctx->{unix_name} gecos:$ctx->{prefix_abs}:/bin/false\n";
 	print PWD "nobody:x:65534:65533:nobody gecos:$ctx->{prefix_abs}:/bin/false
 pdbtest:x:65533:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
 pdbtest2:x:65532:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
@@ -719,7 +719,7 @@ pdbtest4:x:65530:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
 	}
 	print GRP "$ctx->{unix_name}:x:$ctx->{unix_gid}:\n";
 	print GRP "wheel:x:10:
-users:x:100:
+users:x:65531:
 nobody:x:65533:
 nogroup:x:65534:nobody
 ";
-- 
2.1.0


From bc574f0318cb252dace16e3709ea1e725639d8a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Mon, 2 Feb 2015 14:54:01 +0100
Subject: [PATCH 6/6] selftest: re-enable nss_winbind testing via nss_wrapper.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Without exporting these new variables, we can never access or test nss_winbind
from the selftest environments.

Guenther

Signed-off-by: G?nther Deschner <gd at samba.org>
Pair-Programmed-With: Michael Adam <obnox at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
---
 selftest/selftest.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 2bbb3c8..72341f0 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -793,6 +793,8 @@ my @exported_envvars = (
 	"NSS_WRAPPER_PASSWD",
 	"NSS_WRAPPER_GROUP",
 	"NSS_WRAPPER_HOSTS",
+	"NSS_WRAPPER_MODULE_SO_PATH",
+	"NSS_WRAPPER_MODULE_FN_PREFIX",
 
 	# resolv_wrapper
 	"RESOLV_WRAPPER_CONF",
-- 
2.1.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150213/42d082d8/attachment.pgp>


More information about the samba-technical mailing list