s3:selftest:test.py: plan clustered member tests based on build
authorMichael Adam <obnox@samba.org>
Thu, 20 Oct 2011 00:18:05 +0000 (02:18 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 26 Sep 2013 00:19:47 +0000 (02:19 +0200)
So if the build is clustered then run member tests against
the clusteredmember env, otherwise against plain member.

source3/selftest/tests.py

index b4c41fd40487d0feb147dc7f4a408c2c7af0d038..304375666dba6adffd2db9633886d77a1254fa99 100755 (executable)
@@ -41,6 +41,26 @@ if os.getenv("SELFTEST_QUICK"):
     torture_options.append("--option=torture:quick=yes")
 smb4torture += " " + " ".join(torture_options)
 
+
+# check whether samba was build with cluster support:
+try:
+    config_h = os.environ["CONFIG_H"]
+except KeyError:
+    config_h = os.path.join(bindir(), "default/include/config.h")
+
+f = open(config_h, 'r')
+try:
+    with_cluster_support = ("CLUSTER_SUPPORT 1" in f.read())
+finally:
+    f.close
+
+memberenvs = ["member"]
+localmemberenvs = ["member:local"]
+if with_cluster_support:
+    memberenvs.append("clusteredmember")
+    localmemberenvs.append("clusteredmember:local")
+
+
 def plansmbtorturetestsuite(name, env, options, description=''):
     modname = "samba3.posix_s3.%s %s" % (name, description)
     cmdline = "%s $LISTOPT %s %s" % (valgrindify(smb4torture), options, name)
@@ -93,9 +113,10 @@ for t in tests:
     plantestsuite("samba3.wbinfo_s3.(s3dc:local).%s" % t, "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
     plantestsuite("samba3.wbinfo_s3.(member:local).%s" % t, "member:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
 
-plantestsuite(
-    "samba3.wbinfo_sids2xids.(member:local)", "member:local",
-    [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
+for env in localmemberenvs:
+    plantestsuite(
+        "samba3.wbinfo_sids2xids.(%s)" % env, env,
+        [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
 
 plantestsuite("samba3.ntlm_auth.(s3dc:local)", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, binpath('ntlm_auth3'), configuration])
 
@@ -118,7 +139,7 @@ plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) bad username" % env, en
 for env in ["s3dc"]:
     plantestsuite("samba3.blackbox.smbclient_s3.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration])
 
-for env in ["member"]:
+for env in memberenvs:
     plantestsuite("samba3.blackbox.smbclient_s3.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration])
 
 for env in ["s3dc"]: