From c8f31ef3b3a010f051435d3a52809f3a39462138 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 20 Mar 2018 14:15:47 +1300 Subject: [PATCH 01/25] gitlab-ci: Create swap space to work around the 2G image Signed-off-by: Andrew Bartlett --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ae9eb4032d1..aa367dd59f2b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,10 @@ # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options before_script: - - echo "Build starting ..." + - echo "Build starting (preparing swap)..." + - sudo dd if=/dev/zero of=/samba-swap bs=1M count=10240 + - sudo mkswap /samba-swap + - sudo swapon /samba-swap build_samba: stage: build From dc80400a3ab603f0c5a547c6d92737d77852cc03 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Tue, 28 Nov 2017 10:20:54 +1300 Subject: [PATCH 02/25] gitlab-ci: set docker image and change tag 1. Specify docker image to use in gitlab-ci.yml 2. Change tag autobuild to docker So we can use gitlab.com shared runners. Signed-off-by: Joe Guo --- .gitlab-ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa367dd59f2b..04a01c0f2573 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,7 @@ # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options +image: registry.gitlab.com/catalyst-samba/samba:latest + before_script: - echo "Build starting (preparing swap)..." - sudo dd if=/dev/zero of=/samba-swap bs=1M count=10240 @@ -9,7 +11,7 @@ before_script: build_samba: stage: build tags: - - autobuild + - docker script: # this one takes about 4 hours to finish - python script/autobuild.py samba --verbose --tail --testbase /tmp/samba-testbase @@ -17,7 +19,7 @@ build_samba: build_samba_others: stage: build tags: - - autobuild + - docker script: - python script/autobuild.py samba-nopython --verbose --tail --testbase /tmp/samba-testbase - python script/autobuild.py samba-systemkrb5 --verbose --tail --testbase /tmp/samba-testbase @@ -29,7 +31,7 @@ build_samba_others: build_ctdb: stage: build tags: - - autobuild + - docker script: - python script/autobuild.py samba-ctdb --verbose --tail --testbase /tmp/samba-testbase - python script/autobuild.py ctdb --verbose --tail --testbase /tmp/samba-testbase @@ -37,7 +39,7 @@ build_ctdb: build_others: stage: build tags: - - autobuild + - docker script: - python script/autobuild.py ldb --verbose --tail --testbase /tmp/samba-testbase - python script/autobuild.py pidl --verbose --tail --testbase /tmp/samba-testbase From eeb3eeac0b02bde4ca9f530a07abcd0eb6058419 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Tue, 12 Dec 2017 14:26:07 +1300 Subject: [PATCH 03/25] gitlab-ci: add git variable to speed up clone Set GIT_STATEGY to fetch, and GIT_DEPTH to 3. This will speed up cloning for repos. Signed-off-by: Joe Guo --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04a01c0f2573..98006dbe8deb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,10 @@ image: registry.gitlab.com/catalyst-samba/samba:latest +variables: + GIT_STRATEGY: fetch + GIT_DEPTH: "3" + before_script: - echo "Build starting (preparing swap)..." - sudo dd if=/dev/zero of=/samba-swap bs=1M count=10240 From 258b5853edf5fd458105559beb273a48effab375 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Jul 2017 19:54:36 +1200 Subject: [PATCH 04/25] autobuild: Move defaulttasks to one-per-line Signed-off-by: Andrew Bartlett --- script/autobuild.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/script/autobuild.py b/script/autobuild.py index ebe49bb75cbc..fe1a96104fed 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -44,7 +44,21 @@ "retry" : "." } -defaulttasks = [ "ctdb", "samba", "samba-xc", "samba-o3", "samba-ctdb", "samba-libs", "samba-static", "samba-systemkrb5", "samba-nopython", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ] +defaulttasks = [ "ctdb", + "samba", + "samba-xc", + "samba-o3", + "samba-ctdb", + "samba-libs", + "samba-static", + "samba-systemkrb5", + "samba-nopython", + "ldb", + "tdb", + "talloc", + "replace", + "tevent", + "pidl" ] if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1": defaulttasks.remove("samba-o3") From 6b79231fda836699c6cfc4226e6a60724dbd942c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 30 Jun 2017 11:13:55 +1200 Subject: [PATCH 05/25] autobuild: Run all "ad_dc" environment tests in samba-o3 This allows us not to run ad_dc tests in the main build, making the autobuild process faster. The ad_dc tests run in less than 50mins on travis-ci, which allows this part of the tests to be run. Signed-off-by: Andrew Bartlett --- script/autobuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index fe1a96104fed..d3742101fd4c 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -90,7 +90,7 @@ # We have 'test' before 'install' because, 'test' should work without 'install' "samba" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), - ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--exclude-env=ad_dc'", "text/plain"), ("install", "make install", "text/plain"), ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], @@ -107,11 +107,11 @@ " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa/ab" + samba_configure_params, "text/plain"), ("compare-results", "script/compare_cc_results.py ./bin/c4che/default.cache.py ./bin-xe/c4che/default.cache.py ./bin-xa/c4che/default.cache.py", "text/plain")], - # test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environments + # test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environment "samba-o3" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"), ("configure", "ADDITIONAL_CFLAGS='-O3' ./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), - ("test", "make quicktest FAIL_IMMEDIATELY=1 TESTS='--include-env=ad_dc'", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=ad_dc'", "text/plain"), ("install", "make install", "text/plain"), ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], From 5f117631b6ff4ae12a2362f79d28ef86222f2533 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 30 Jun 2017 11:15:40 +1200 Subject: [PATCH 06/25] autobuild: Run nt4_dc and nt4_member tests in parallel These do not interact with the main AD DC environments, so can run in parallel Signed-off-by: Andrew Bartlett --- script/autobuild.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index d3742101fd4c..cc325ab1a9b7 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -25,6 +25,7 @@ builddirs = { "ctdb" : "ctdb", "samba" : ".", + "samba-nt4" : ".", "samba-xc" : ".", "samba-o3" : ".", "samba-ctdb" : ".", @@ -46,6 +47,7 @@ defaulttasks = [ "ctdb", "samba", + "samba-nt4", "samba-xc", "samba-o3", "samba-ctdb", @@ -87,14 +89,22 @@ ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], - # We have 'test' before 'install' because, 'test' should work without 'install' + # We have 'test' before 'install' because, 'test' should work without 'install (runs ad_dc_ntvfs and all the other envs)' "samba" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), - ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--exclude-env=ad_dc'", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--exclude-env=nt4_dc --exclude-env=nt4_member --exclude-env=ad_dc'", "text/plain"), ("install", "make install", "text/plain"), ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], + # We split out this so the isolated nt4_dc tests do not wait for ad_dc or ad_dc_ntvfs tests (which are long) + "samba-nt4" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), + ("make", "make -j", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=nt4_dc --include-env=nt4_member'", "text/plain"), + ("install", "make install", "text/plain"), + ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), + ("clean", "make clean", "text/plain") ], + "samba-test-only" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), ("test", 'make test FAIL_IMMEDIATELY=1 TESTS="${TESTS}"',"text/plain") ], From cef003434278ceda800e14d7d54adfcd83f85722 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 30 Jun 2017 11:44:58 +1200 Subject: [PATCH 07/25] travis-ci: Run new samba-nt4 environment Signed-off-by: Andrew Bartlett --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 645658b9e7dd..db0e00f66dfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ env: - TASK=samba-o3 - TASK=samba-nopython - TASK=samba-systemkrb5 + - TASK=samba-nt4 - TASK=ldb - TASK=tdb - TASK=talloc From 02a9a2deccb49ae6842487fc0406d32438cf195e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 5 Dec 2017 11:34:08 +1300 Subject: [PATCH 08/25] gitlab-ci: Add samba-nt4 environment to the CI This parallel build is de-coupled from the main samba build Signed-off-by: Andrew Bartlett --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98006dbe8deb..b42df8165e8a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,14 @@ build_samba: # this one takes about 4 hours to finish - python script/autobuild.py samba --verbose --tail --testbase /tmp/samba-testbase +build_samba_nt4: + stage: build + tags: + - autobuild + script: + # this one takes about 1 hours to finish + - python script/autobuild.py samba-nt4 --verbose --tail --testbase /tmp/samba-testbase + build_samba_others: stage: build tags: From e17070828acf74365e5ee23698a2b86dc9cf2774 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 3 Mar 2018 19:51:29 +1300 Subject: [PATCH 09/25] autobuild: Move "none" environment to samba-none-env This takes this part of the test out of the main, slow samba task but also keeps it away from samba-o3 which is up against the 50min budget on travis-ci. Signed-off-by: Andrew Bartlett --- .gitlab-ci.yml | 8 ++++++++ .travis.yml | 1 + script/autobuild.py | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b42df8165e8a..17b612f4fbb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,14 @@ build_samba_nt4: # this one takes about 1 hours to finish - python script/autobuild.py samba-nt4 --verbose --tail --testbase /tmp/samba-testbase +build_samba_none_env: + stage: build + tags: + - autobuild + script: + # this one takes about 1 hours to finish + - python script/autobuild.py samba-none-env --verbose --tail --testbase /tmp/samba-testbase + build_samba_others: stage: build tags: diff --git a/.travis.yml b/.travis.yml index db0e00f66dfb..fb9d4565f224 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: - TASK=samba-libs - TASK=samba-static - TASK=samba-o3 + - TASK=samba-none-env - TASK=samba-nopython - TASK=samba-systemkrb5 - TASK=samba-nt4 diff --git a/script/autobuild.py b/script/autobuild.py index cc325ab1a9b7..5930ea0fa4bc 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -32,6 +32,7 @@ "samba-libs" : ".", "samba-static" : ".", "samba-test-only" : ".", + "samba-none-env" : ".", "samba-systemkrb5" : ".", "samba-nopython" : ".", "ldb" : "lib/ldb", @@ -53,6 +54,7 @@ "samba-ctdb", "samba-libs", "samba-static", + "samba-none-env", "samba-systemkrb5", "samba-nopython", "ldb", @@ -92,7 +94,11 @@ # We have 'test' before 'install' because, 'test' should work without 'install (runs ad_dc_ntvfs and all the other envs)' "samba" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), - ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--exclude-env=nt4_dc --exclude-env=nt4_member --exclude-env=ad_dc'", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 " + "TESTS='--exclude-env=nt4_dc " + "--exclude-env=nt4_member " + "--exclude-env=ad_dc --exclude-env=none'", + "text/plain"), ("install", "make install", "text/plain"), ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], @@ -175,6 +181,15 @@ ("allshared-configure", samba_libs_configure_samba + " --with-shared-modules=ALL", "text/plain"), ("allshared-make", "make -j", "text/plain")], + "samba-none-env" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), + ("make", "make -j", "text/plain"), + ("test", "make test " + "FAIL_IMMEDIATELY=1 " + "TESTS='--include-env=none'", + "text/plain")], + "samba-static" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), # build with all modules static From c6351d2c817869f1b43334d277bb6489fac8736e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 3 Mar 2018 21:03:11 +1300 Subject: [PATCH 10/25] selftest: Do not run smb2.notify against nt4_dc and ad_dc This is a slow test and we need to keep the time on ad_dc down to below 50mins total for travis-ci. Signed-off-by: Andrew Bartlett --- source3/selftest/tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index c93abf5e6323..a65edcea7130 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -519,7 +519,6 @@ def plansmbtorture4testsuite(name, env, options, description=''): plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD') elif t == "smb2.notify": plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --signing=required') - plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD --signing=required') elif t == "smb2.dosmode": plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD') elif t == "smb2.kernel-oplocks": From 37a30fa6c8d2d61ac43bb4357769b94e980d4135 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 3 Mar 2018 22:01:38 +1300 Subject: [PATCH 11/25] Move ad_dc tests out of samba-o3 as that build takes longer and we run out of time Signed-off-by: Andrew Bartlett --- .gitlab-ci.yml | 8 ++++++++ .travis.yml | 1 + script/autobuild.py | 12 ++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17b612f4fbb8..43a17f04c576 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,14 @@ build_samba_nt4: # this one takes about 1 hours to finish - python script/autobuild.py samba-nt4 --verbose --tail --testbase /tmp/samba-testbase +build_samba_ad_dc: + stage: build + tags: + - autobuild + script: + # this one takes about 1 hours to finish + - python script/autobuild.py samba-ad-dc --verbose --tail --testbase /tmp/samba-testbase + build_samba_none_env: stage: build tags: diff --git a/.travis.yml b/.travis.yml index fb9d4565f224..61b1d8770d7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ env: - TASK=samba-nopython - TASK=samba-systemkrb5 - TASK=samba-nt4 + - TASK=samba-ad-dc - TASK=ldb - TASK=tdb - TASK=talloc diff --git a/script/autobuild.py b/script/autobuild.py index 5930ea0fa4bc..91dc80bc7f7b 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -33,6 +33,7 @@ "samba-static" : ".", "samba-test-only" : ".", "samba-none-env" : ".", + "samba-ad-dc" : ".", "samba-systemkrb5" : ".", "samba-nopython" : ".", "ldb" : "lib/ldb", @@ -55,6 +56,7 @@ "samba-libs", "samba-static", "samba-none-env", + "samba-ad-dc", "samba-systemkrb5", "samba-nopython", "ldb", @@ -111,6 +113,13 @@ ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], + # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long) + "samba-ad-dc" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), + ("make", "make -j", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=ad_dc'", "text/plain"), + ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")], + "samba-test-only" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), ("test", 'make test FAIL_IMMEDIATELY=1 TESTS="${TESTS}"',"text/plain") ], @@ -123,11 +132,10 @@ " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa/ab" + samba_configure_params, "text/plain"), ("compare-results", "script/compare_cc_results.py ./bin/c4che/default.cache.py ./bin-xe/c4che/default.cache.py ./bin-xa/c4che/default.cache.py", "text/plain")], - # test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environment + # test build with -O3 -- catches extra warnings and bugs "samba-o3" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"), ("configure", "ADDITIONAL_CFLAGS='-O3' ./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), - ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=ad_dc'", "text/plain"), ("install", "make install", "text/plain"), ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], From 84a6a101ab37d7afd5c3ac91b39fea34dd651696 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 3 Mar 2018 21:24:47 +1300 Subject: [PATCH 12/25] travis-ci: Only un-shallow for PIDL Signed-off-by: Andrew Bartlett --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 61b1d8770d7b..2ab086bffb52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,5 +33,7 @@ before_install: - sudo apt-get install --assume-yes acl attr autoconf bind9utils bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls-dev libgpgme11-dev libjson-perl libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev nettle-dev perl perl-modules pkg-config python-all-dev python-crypto python-dbg python-dev python-dnspython python3-dnspython python-gpgme python3-gpgme python-markdown python3-markdown python3-dev xsltproc zlib1g-dev script: - - git fetch --unshallow + - if [ $TASK = "pidl" ]; then + git fetch --unshallow; + fi - ./script/autobuild.py --tail --testbase=/tmp $TASK From af41e6fba625954a176ff73e5590b62d12b207eb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 3 Mar 2018 23:39:24 +1300 Subject: [PATCH 13/25] travis-ci: Use Gold linker for faster builds Signed-off-by: Andrew Bartlett --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2ab086bffb52..bfd60f5588e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,10 @@ matrix: before_install: - sudo apt-get update -qq - sudo apt-get install --assume-yes acl attr autoconf bind9utils bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls-dev libgpgme11-dev libjson-perl libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev nettle-dev perl perl-modules pkg-config python-all-dev python-crypto python-dbg python-dev python-dnspython python3-dnspython python-gpgme python3-gpgme python-markdown python3-markdown python3-dev xsltproc zlib1g-dev + - sudo apt-get install --assume-yes binutils-gold + - sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20 + - sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10 + - sudo update-alternatives --set ld /usr/bin/ld.gold script: - if [ $TASK = "pidl" ]; then From 700ba542cf2c19327df0d74159124592676af603 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Mar 2018 21:32:09 +1300 Subject: [PATCH 14/25] autobuild: Remove fileserver tests from the main build Signed-off-by: Andrew Bartlett --- .gitlab-ci.yml | 8 ++++++++ .travis.yml | 1 + script/autobuild.py | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43a17f04c576..6037f32d6d18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,14 @@ build_samba_nt4: # this one takes about 1 hours to finish - python script/autobuild.py samba-nt4 --verbose --tail --testbase /tmp/samba-testbase +build_samba_fileserver: + stage: build + tags: + - autobuild + script: + # this one takes about 1 hours to finish + - python script/autobuild.py samba-fileserver --verbose --tail --testbase /tmp/samba-testbase + build_samba_ad_dc: stage: build tags: diff --git a/.travis.yml b/.travis.yml index bfd60f5588e2..deca01d6f5ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ env: - TASK=samba-nopython - TASK=samba-systemkrb5 - TASK=samba-nt4 + - TASK=samba-fileserver - TASK=samba-ad-dc - TASK=ldb - TASK=tdb diff --git a/script/autobuild.py b/script/autobuild.py index 91dc80bc7f7b..59fea48f5ccd 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -26,6 +26,7 @@ "ctdb" : "ctdb", "samba" : ".", "samba-nt4" : ".", + "samba-fileserver" : ".", "samba-xc" : ".", "samba-o3" : ".", "samba-ctdb" : ".", @@ -50,6 +51,7 @@ defaulttasks = [ "ctdb", "samba", "samba-nt4", + "samba-fileserver", "samba-xc", "samba-o3", "samba-ctdb", @@ -99,6 +101,7 @@ ("test", "make test FAIL_IMMEDIATELY=1 " "TESTS='--exclude-env=nt4_dc " "--exclude-env=nt4_member " + "--exclude-env=fileserver " "--exclude-env=ad_dc --exclude-env=none'", "text/plain"), ("install", "make install", "text/plain"), @@ -113,6 +116,13 @@ ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], + # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long) + "samba-fileserver" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), + ("make", "make -j", "text/plain"), + ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=fileserver'", "text/plain"), + ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")], + # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long) "samba-ad-dc" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"), ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), From 0ac35e8c617cac0697579e5cc4da16f1ec5a6ac7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Mar 2018 21:20:31 +1300 Subject: [PATCH 15/25] selftest: Move base.delaywrite tests to fileserver environment This aims to keep the ad_dc tests well below 50mins for travis CI and base.delaywrite is very slow. Signed-off-by: Andrew Bartlett --- source3/selftest/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index a65edcea7130..9ac8233aa6ce 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -405,7 +405,7 @@ def plansmbtorture4testsuite(name, env, options, description=''): for t in tests: if t == "base.delaywrite": - plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900') + plansmbtorture4testsuite(t, "fileserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900') elif t == "base.createx_access": plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900') elif t == "rap.sam": From a7411456842cbfca4fb190c4854f522f86dfa774 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Mar 2018 21:33:50 +1300 Subject: [PATCH 16/25] Move smbtorture3 tests to fileserver environment Signed-off-by: Andrew Bartlett --- source3/selftest/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 9ac8233aa6ce..393615cb77c3 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -85,7 +85,7 @@ def plansmbtorture4testsuite(name, env, options, description=''): "BAD-NBT-SESSION"] for t in tests: - plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"]) + plantestsuite("samba3.smbtorture_s3.plain(fileserver).%s" % t, "fileserver", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"]) plantestsuite("samba3.smbtorture_s3.crypt_client(nt4_dc).%s" % t, "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"]) if t == "TORTURE": # this is a negative test to verify that the server rejects From 5c950c5e060507af6b4bbc4799c0b6babae24186 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Mar 2018 21:36:22 +1300 Subject: [PATCH 17/25] autobuild: Try and test different configure options for new environments Signed-off-by: Andrew Bartlett --- script/autobuild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/autobuild.py b/script/autobuild.py index 59fea48f5ccd..8a3cce21d1d0 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -118,7 +118,7 @@ # We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long) "samba-fileserver" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"), - ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), + ("configure", "./configure.developer --without-ad-dc --without-ads --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"), ("make", "make -j", "text/plain"), ("test", "make test FAIL_IMMEDIATELY=1 TESTS='--include-env=fileserver'", "text/plain"), ("check-clean-tree", "script/clean-source-tree.sh", "text/plain")], From b42ad3818819164f718e88fcd17e428543470205 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Mar 2018 22:31:00 +1300 Subject: [PATCH 18/25] libsmb: Use the same #ifdef for is_our_primary_domain() as the only caller Signed-off-by: Andrew Bartlett --- source3/libsmb/namequery_dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c index eb34741defa3..d08456590f6d 100644 --- a/source3/libsmb/namequery_dc.c +++ b/source3/libsmb/namequery_dc.c @@ -32,7 +32,7 @@ Is this our primary domain ? **********************************************************************/ -#ifdef HAVE_KRB5 +#ifdef HAVE_ADS static bool is_our_primary_domain(const char *domain) { int role = lp_server_role(); From 737c20568d1bb95686e9b6c76b4192bd32acc79d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 4 Mar 2018 22:57:22 +1300 Subject: [PATCH 19/25] s3-libnet: move rpc_join label into HAVE_ADS block with only caller Signed-off-by: Andrew Bartlett --- source3/libnet/libnet_join.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 9b1bf342c19e..3fe29b4be95a 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -2653,9 +2653,10 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx, DEBUG(5, ("failed to precreate account in ou %s: %s", r->in.account_ou, ads_errstr(ads_status))); } + rpc_join: + #endif /* HAVE_ADS */ - rpc_join: if ((r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE) && (r->in.join_flags & WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED)) { status = libnet_join_joindomain_rpc_unsecure(mem_ctx, r, cli); From c56879fba1630c46efa571dcad2172ba95918515 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Mar 2018 08:04:22 +1300 Subject: [PATCH 20/25] selftest: Move slower base.deny1 and base.deny2 to fileserver environment This avoids these running in the ad_dc environment which we need to get under 50mins for travis-ci. Signed-off-by: Andrew Bartlett --- source3/selftest/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 393615cb77c3..00e04318c7cd 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -404,7 +404,7 @@ def plansmbtorture4testsuite(name, env, options, description=''): tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap + vfs for t in tests: - if t == "base.delaywrite": + if t == "base.delaywrite" or t == "base.deny1" or t == "base.deny2": plansmbtorture4testsuite(t, "fileserver", '//$SERVER/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900') elif t == "base.createx_access": plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD -k yes --maximum-runtime=900') From e66067e84fde632afdd8a2ae421a0331161ef838 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Mar 2018 17:08:51 +1300 Subject: [PATCH 21/25] selftest: Move samba.tests.samba_tool.dnscmd and samba.tests.samba_tool.sites to fl2008r2dc This helps reduce the runtime of ad_dc which needs to be under 50mins including build time to run on travis-ci. Signed-off-by: Andrew Bartlett --- source4/selftest/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index ef752a51cdfe..5db5ab169cdf 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -609,8 +609,9 @@ def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, ex planpythontestsuite("none", "samba.tests.samba_tool.provision_password_check") planpythontestsuite("none", "samba.tests.samba_tool.help") -planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.sites") -planpythontestsuite("ad_dc:local", "samba.tests.samba_tool.dnscmd") +# Run these against fl2008r2dc to share the runtime load +planpythontestsuite("fl2008r2dc:local", "samba.tests.samba_tool.sites") +planpythontestsuite("fl2008r2dc:local", "samba.tests.samba_tool.dnscmd") planpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.rpcecho") planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.dcerpc.registry", extra_args=['-U"$USERNAME%$PASSWORD"']) From cb65691b91f61aee1a9144b8671470774338e6fb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 20 Mar 2018 15:07:03 +1300 Subject: [PATCH 22/25] gitlab-ci: Set shared and private tags to allow builds that need ext4 to pass Signed-off-by: Andrew Bartlett --- .gitlab-ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6037f32d6d18..e9268a63c096 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,7 @@ build_samba: stage: build tags: - docker + - private script: # this one takes about 4 hours to finish - python script/autobuild.py samba --verbose --tail --testbase /tmp/samba-testbase @@ -23,7 +24,8 @@ build_samba: build_samba_nt4: stage: build tags: - - autobuild + - docker + - private script: # this one takes about 1 hours to finish - python script/autobuild.py samba-nt4 --verbose --tail --testbase /tmp/samba-testbase @@ -31,7 +33,8 @@ build_samba_nt4: build_samba_fileserver: stage: build tags: - - autobuild + - docker + - shared script: # this one takes about 1 hours to finish - python script/autobuild.py samba-fileserver --verbose --tail --testbase /tmp/samba-testbase @@ -39,7 +42,8 @@ build_samba_fileserver: build_samba_ad_dc: stage: build tags: - - autobuild + - docker + - private script: # this one takes about 1 hours to finish - python script/autobuild.py samba-ad-dc --verbose --tail --testbase /tmp/samba-testbase @@ -47,7 +51,8 @@ build_samba_ad_dc: build_samba_none_env: stage: build tags: - - autobuild + - docker + - shared script: # this one takes about 1 hours to finish - python script/autobuild.py samba-none-env --verbose --tail --testbase /tmp/samba-testbase @@ -56,6 +61,7 @@ build_samba_others: stage: build tags: - docker + - shared script: - python script/autobuild.py samba-nopython --verbose --tail --testbase /tmp/samba-testbase - python script/autobuild.py samba-systemkrb5 --verbose --tail --testbase /tmp/samba-testbase @@ -68,6 +74,7 @@ build_ctdb: stage: build tags: - docker + - shared script: - python script/autobuild.py samba-ctdb --verbose --tail --testbase /tmp/samba-testbase - python script/autobuild.py ctdb --verbose --tail --testbase /tmp/samba-testbase @@ -76,6 +83,7 @@ build_others: stage: build tags: - docker + - shared script: - python script/autobuild.py ldb --verbose --tail --testbase /tmp/samba-testbase - python script/autobuild.py pidl --verbose --tail --testbase /tmp/samba-testbase From a2afba677525edb67034ea83164682ff10db4c73 Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Mon, 29 Jan 2018 18:59:34 +1300 Subject: [PATCH 23/25] selftest: Clear environment before provision Currently, if an environment is being provisioned after a test which used ad_member_rfc2307, the provisioning process has all of the following in its environment: { 'DC_NETBIOSNAME' => 'LOCALDC', 'DC_PASSWORD' => 'locDCpass1', 'DC_SERVER_IP' => '127.0.0.21', 'DC_SERVER_IPV6' => 'fd00:0000:0000:0000:0000:0000:5357:5f15', 'DC_SERVER' => 'localdc', 'DC_USERNAME' => 'Administrator', 'DOMAIN' => 'SAMBADOMAIN', 'LOCAL_PATH' => '/.../st/ad_member_rfc2307/share', 'LOCK_DIR' => '/.../st/ad_member_rfc2307/lockdir', 'NETBIOSNAME' => 'RFC2307MEMBER', 'NMBD_SOCKET_DIR' => '/.../st/ad_member_rfc2307/nmbd', 'NSS_WRAPPER_GROUP' => '/.../st/ad_member_rfc2307/private/group', 'NSS_WRAPPER_HOSTNAME' => 'rfc2307member.samba.example.com', 'NSS_WRAPPER_HOSTS' => '/.../st/hosts', 'NSS_WRAPPER_MODULE_FN_PREFIX' => 'winbind', 'NSS_WRAPPER_MODULE_SO_PATH' => '/.../bin/default/nsswitch/libnss-wrapper-winbind.so', 'NSS_WRAPPER_PASSWD' => '/.../st/ad_member_rfc2307/private/passwd', 'PASSWORD' => 'loCalMemberPass', 'REALM' => 'SAMBA.EXAMPLE.COM', 'RESOLV_WRAPPER_HOSTS' => '/.../st/dns_host_file', 'SELFTEST_WINBINDD_SOCKET_DIR' => '/.../st/ad_member_rfc2307/winbindd', 'SERVER_IP' => '127.0.0.34', 'SERVER_IPV6' => 'fd00:0000:0000:0000:0000:0000:5357:5f22', 'SERVER' => 'RFC2307MEMBER', 'USERID' => '55668', 'USERNAME' => 'jamiemcclymont', } Unsurprisingly, some of these can cause issues for the provisioning process, if a reduced subset of tests is being run which causes the provision to encounter never-before-seen pairs of adjacent environments. For example, a run with only TESTS='--include-env=vampire_dc --include-env=ad_member_rfc2307' would fail to start up the vampire_dc with: Could not find machine account in secrets database: Failed to fetch machine account password from secrets.ldb: Could not find entry to match filter: '(&(flatname=SAMBADOMAIN)(objectclass=primaryDomain))' base: 'cn=Primary Domains': No such object: dsdb_search at ../source4/dsdb/common/util.c:4641 Signed-off-by: Jamie McClymont --- selftest/selftest.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 12452bc420d3..1ec60b76f33b 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -939,6 +939,19 @@ ($$) $option = "client" if $option eq ""; + # Initially clear out the environment for the provision, so previous envs' + # variables don't leak in. Provisioning steps must explicitly set their + # necessary variables when calling out to other executables + foreach (@exported_envvars) { + unless ($_ == "NSS_WRAPPER_HOSTS" || + $_ == "RESOLV_WRAPPER_HOSTS") + { + delete $ENV{$_}; + } + } + delete $ENV{SOCKET_WRAPPER_DEFAULT_IFACE}; + delete $ENV{SMB_CONF_PATH}; + $ENV{KRB5CCNAME} = "FILE:${selftest_krbt_ccache_path}.${envname}/ignore"; if (defined(get_running_env($envname))) { From 7fc09644aae74e507819b889082e47f395495290 Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Wed, 10 Jan 2018 13:28:13 +1300 Subject: [PATCH 24/25] s4:selftest: explicitly set NSS/RESOLV_WAPPER_* in wait_for_start These variables were previously set directly on the selftest process for the purpose of making this ldbsearch call, allowing them to leak into other environments. Signed-off-by: Jamie McClymont Reviewed-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- selftest/target/Samba4.pm | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index fd4e4b619843..3b687ec25696 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -215,14 +215,6 @@ sub wait_for_start($$) # Ensure we have the first RID Set before we start tests. This makes the tests more reliable. if ($testenv_vars->{SERVER_ROLE} eq "domain controller") { - # Add hosts file for name lookups - $ENV{NSS_WRAPPER_HOSTS} = $testenv_vars->{NSS_WRAPPER_HOSTS}; - if (defined($testenv_vars->{RESOLV_WRAPPER_CONF})) { - $ENV{RESOLV_WRAPPER_CONF} = $testenv_vars->{RESOLV_WRAPPER_CONF}; - } else { - $ENV{RESOLV_WRAPPER_HOSTS} = $testenv_vars->{RESOLV_WRAPPER_HOSTS}; - } - print "waiting for working LDAP and a RID Set to be allocated\n"; my $ldbsearch = Samba::bindir_path($self, "ldbsearch"); my $count = 0; @@ -234,7 +226,21 @@ sub wait_for_start($$) $search_dn = "cn=RID Set,cn=$testenv_vars->{NETBIOSNAME},ou=domain controllers,$base_dn"; } my $max_wait = 60; - my $cmd = "$ldbsearch $testenv_vars->{CONFIGURATION} -H ldap://$testenv_vars->{SERVER} -U$testenv_vars->{USERNAME}%$testenv_vars->{PASSWORD} -s base -b \"$search_dn\""; + + # Add hosts file for name lookups + my $cmd = "NSS_WRAPPER_HOSTS='$testenv_vars->{NSS_WRAPPER_HOSTS}' "; + if (defined($testenv_vars->{RESOLV_WRAPPER_CONF})) { + $cmd .= "RESOLV_WRAPPER_CONF='$testenv_vars->{RESOLV_WRAPPER_CONF}' "; + } else { + $cmd .= "RESOLV_WRAPPER_HOSTS='$testenv_vars->{RESOLV_WRAPPER_HOSTS}' "; + } + + $cmd .= "$ldbsearch "; + $cmd .= "$testenv_vars->{CONFIGURATION} "; + $cmd .= "-H ldap://$testenv_vars->{SERVER} "; + $cmd .= "-U$testenv_vars->{USERNAME}%$testenv_vars->{PASSWORD} "; + $cmd .= "-s base "; + $cmd .= "-b '$search_dn' "; while (system("$cmd >/dev/null") != 0) { $count++; if ($count > $max_wait) { From fac85f154f4a29910910e09a6ee2a14763b98207 Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Thu, 25 Jan 2018 17:23:06 +1300 Subject: [PATCH 25/25] selftest: consistently produce high-res UTC time Currently some subunit reporters throughout the codebase provide low-res time, meaning timestamps jump back and forth in the subunit file. Also, some subunit reporters produce UTC timestamps while others produce local time. UTC was chosen as the standard for this commit since all of the timestamps end with a Z (= Zulu = UTC). Signed-off-by: Jamie McClymont --- lib/torture/subunit.c | 4 ++-- selftest/Subunit.pm | 6 ++++-- selftest/selftest.pl | 7 ++++--- source4/torture/rpc/witness.c | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/torture/subunit.c b/lib/torture/subunit.c index 46f1b65053dd..deb96ffa3a98 100644 --- a/lib/torture/subunit.c +++ b/lib/torture/subunit.c @@ -62,9 +62,9 @@ static void torture_subunit_report_time(struct torture_context *tctx) return; } - tmp = localtime(&tp.tv_sec); + tmp = gmtime(&tp.tv_sec); if (!tmp) { - perror("localtime"); + perror("gmtime"); return; } diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm index 1cc0e7216966..46b0fda503cc 100644 --- a/selftest/Subunit.pm +++ b/selftest/Subunit.pm @@ -16,6 +16,7 @@ package Subunit; use POSIX; +use Time::HiRes; require Exporter; @ISA = qw(Exporter); @@ -43,10 +44,11 @@ sub end_test($$;$) } } -sub report_time($) +sub report_time() { my ($time) = @_; - my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time); + $time = Time::HiRes::time() unless (defined($time)); + my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime($time); $sec = ($time - int($time) + $sec); my $msg = sprintf("%f", $sec); if (substr($msg, 1, 1) eq ".") { diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 1ec60b76f33b..d9b7b8da2034 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -28,6 +28,7 @@ use Subunit; use SocketWrapper; use target::Samba; +use Time::HiRes qw(time); eval { require Time::HiRes; @@ -150,9 +151,9 @@ ($$$$$) Subunit::start_testsuite($name); Subunit::progress_push(); - Subunit::report_time(time()); + Subunit::report_time(); system($cmd); - Subunit::report_time(time()); + Subunit::report_time(); Subunit::progress_pop(); if ($? == -1) { @@ -781,7 +782,7 @@ ($) unless ($opt_list) { Subunit::progress($suitestotal); - Subunit::report_time(time()); + Subunit::report_time(); } my $i = 0; diff --git a/source4/torture/rpc/witness.c b/source4/torture/rpc/witness.c index 4b44e91dbcf2..4e7c682a7ee5 100644 --- a/source4/torture/rpc/witness.c +++ b/source4/torture/rpc/witness.c @@ -790,9 +790,9 @@ static void torture_subunit_report_time(struct torture_context *tctx) return; } - tmp = localtime(&tp.tv_sec); + tmp = gmtime(&tp.tv_sec); if (!tmp) { - torture_comment(tctx, "failed to call localtime"); + torture_comment(tctx, "failed to call gmtime"); return; }