[PATCH] Fix running process_limit tests locally

Tim Beale timbeale at catalyst.net.nz
Wed Jan 30 02:29:28 UTC 2019


I noticed that the proclimitdc wouldn't start up locally. Attached is
the trivial fix, plus a few other small, semi-related tidy-ups.

CI pass: https://gitlab.com/catalyst-samba/samba/pipelines/45338074

Review appreciated. Thanks.

-------------- next part --------------
From 953d9f7072f5296c4395c4ccfe392bc04c758693 Mon Sep 17 00:00:00 2001
From: Tim Beale <timbeale at catalyst.net.nz>
Date: Wed, 30 Jan 2019 09:51:44 +1300
Subject: [PATCH 1/4] selftest: Fix running proclimit tests locally

The dns_hub changes missed a dependency. Fortunately, during an
autobuild, the dns_hub is always up and running by the time the
proclimitdc tests are run. However, the tests were failing if run
locally just on their own.

Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
---
 selftest/target/Samba4.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index f2635e5..da00e30 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -2354,7 +2354,7 @@ sub check_env($$)
 	renamedc             => ["backupfromdc"],
 	offlinebackupdc      => ["backupfromdc"],
 	labdc                => ["backupfromdc"],
-	proclimitdc          => [],
+	proclimitdc          => ["dns_hub"],
 
 	none                 => [],
 );
-- 
2.7.4


From 260da7c8f0fecaa984b4b95838cbc0c89e9fc5df Mon Sep 17 00:00:00 2001
From: Tim Beale <timbeale at catalyst.net.nz>
Date: Wed, 30 Jan 2019 09:57:29 +1300
Subject: [PATCH 2/4] selftest: Reorder ENV_DEPS so similar testenvs are
 together

Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
---
 selftest/target/Samba4.pm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index da00e30..21a12f1 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -2330,9 +2330,6 @@ sub check_env($$)
 	ad_dc                => ["dns_hub"],
 	ad_dc_no_nss         => ["dns_hub"],
 	ad_dc_no_ntlm        => ["dns_hub"],
-	backupfromdc         => ["dns_hub"],
-	customdc             => ["dns_hub"],
-	preforkrestartdc     => ["dns_hub"],
 
 	fl2008r2dc           => ["ad_dc"],
 	fl2003dc             => ["ad_dc"],
@@ -2350,11 +2347,17 @@ sub check_env($$)
 	s4member_dflt_domain => ["ad_dc_ntvfs"],
 	s4member             => ["ad_dc_ntvfs"],
 
+	# envs that test the server process model
+	proclimitdc          => ["dns_hub"],
+	preforkrestartdc     => ["dns_hub"],
+
+	# backup/restore testenvs
+	backupfromdc         => ["dns_hub"],
+	customdc             => ["dns_hub"],
 	restoredc            => ["backupfromdc"],
 	renamedc             => ["backupfromdc"],
 	offlinebackupdc      => ["backupfromdc"],
 	labdc                => ["backupfromdc"],
-	proclimitdc          => ["dns_hub"],
 
 	none                 => [],
 );
-- 
2.7.4


From 77dab163daf3ececa0cfd60c7ddab0dcfe3bff8a Mon Sep 17 00:00:00 2001
From: Tim Beale <timbeale at catalyst.net.nz>
Date: Wed, 30 Jan 2019 10:04:28 +1300
Subject: [PATCH 3/4] selftest: Add comment elaborating on what ENV_DEPS
 actually does

Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
---
 selftest/target/Samba4.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 21a12f1..b9039ec 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -2323,6 +2323,10 @@ sub check_env($$)
 # Declare the environments Samba4 makes available.
 # To be set up, they will be called as
 #   samba4->setup_$envname($self, $path, $dep_1_vars, $dep_2_vars, ...)
+# The interdependencies between the testenvs are declared below. Some testenvs
+# are dependent on another testenv running first, e.g. vampire_dc is dependent
+# on ad_dc_ntvfs because vampire_dc joins ad_dc_ntvfs's domain. All DCs are
+# dependent on dns_hub, which handles resolving DNS queries for the realm.
 %Samba4::ENV_DEPS = (
 	# name               => [dep_1, dep_2, ...],
 	dns_hub              => [],
-- 
2.7.4


From dfefc4f9ccdfc75e85849e4c5947ec8748697ff4 Mon Sep 17 00:00:00 2001
From: Tim Beale <timbeale at catalyst.net.nz>
Date: Wed, 30 Jan 2019 10:07:26 +1300
Subject: [PATCH 4/4] selftest: Remove unnecessary tests.py options from
 proclimit tests

It seems like these extra options were just copy-n-pasted from another
test. The process_limits test doesn't actually try to use these env
variables at all. All the test is doing is creating LDAP connections to
the DC. The SOCKET_WRAPPER_DEFAULT_IFACE may have perhaps been needed,
but we can avoid this by dropping ':local' from the testenv and running
the test as a "client" instead.

Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
---
 source4/selftest/tests.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index b813208..7f22268 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -1268,12 +1268,10 @@ planoldpythontestsuite("preforkrestartdc:local",
                        extra_args=['-U"$USERNAME%$PASSWORD"'],
                        name="samba.tests.blackbox.smbcontrol_process",
                        py3_compatible=True)
-planoldpythontestsuite("proclimitdc:local",
+planoldpythontestsuite("proclimitdc",
                        "samba.tests.process_limits",
                        extra_path=[
                            os.path.join(srcdir(), 'python/samba/tests')],
                        extra_args=['-U"$USERNAME%$PASSWORD"'],
-                       environ={'CLIENT_IP': '127.0.0.11',
-                                'SOCKET_WRAPPER_DEFAULT_IFACE': 11},
                        name="samba.tests.process_limits",
                        py3_compatible=True)
-- 
2.7.4



More information about the samba-technical mailing list