[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Thu Feb 14 02:52:02 UTC 2019


The branch, master has been updated
       via  2346cef9fe8 .gitlab-ci.yml: Make docker image name more explicit
       via  7c1ae35b7fb .gitlab-ci.yml: Include the actual command used by gitlab
       via  2381febcfaf .gitlab-ci.yml: Re-indent comments on test times
       via  20017b57061 .gitlab-ci.yml: Use .extends to avoid duplication of autobuild command
       via  da566447923 .gitlab-ci.yml: Fix the registry as "registry.gitlab.com"
       via  7dcf51282a5 .gitlab-ci.yml: add retries on runner_system_failure/stuck_or_timeout_failure
       via  a61e121e171 .gitlab-ci*.yml: use 'extends: ' instead of YAML Anchors
       via  305db94c581 .gitlab-ci*.yml: remove build_ prefixes
       via  670413f0f16 .gitlab-ci.yml: print out more information in the before_script section
       via  35d66610ca9 script/autobuild.py: add 'lsb_release -a' and 'mount' to system-info.txt
       via  8c0853b80c4 selftest:Samba4: wait for DNS names being registered
       via  b988695ed7a selftest:Samba4: report when samba is started and ready
       via  19f34b2161d samba_dnsupdate: make rodc_dns_update() more robust against timing problems
       via  767e60d9739 samba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate
       via  2f2da0966ba winbindd_irpc: remove unused winbind_DsrUpdateReadOnlyServerDnsRecords from wb_irpc_forward_state
       via  dd3a536b81a s4:setup: register ${NTDSGUID}._msdcs.${DNSFOREST} first in dns_update_list
       via  2543bba0364 messages_dgm: Properly handle receiver re-initialization
       via  8d8f62c4b9d torture3: Extend read3 for the "messaging target re-inits" failure
       via  c27afc09839 messages_dgm: Use saved errno value
      from  3a793497796 waf: Check for libnscd

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2346cef9fe83bca1e432ee78de94b956bc712a0b
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Feb 14 12:26:26 2019 +1300

    .gitlab-ci.yml: Make docker image name more explicit
    
    The 'image' YAML tag implies a docker image, but for people who find
    gitlab mysterious, let's make it blatantly obvious what we're doing
    here.
    
    + added a comment
    + added 'DOCKER' to the variable names
    + removed 'BUILD', as we've now dropped this from all the job-names
    + tried to make the variable names consistent, both within the file and
    WRT docker terminology
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Feb 14 03:51:21 CET 2019 on sn-devel-144

commit 7c1ae35b7fb519107bdea0ae85a211325747af95
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Feb 14 11:20:16 2019 +1300

    .gitlab-ci.yml: Include the actual command used by gitlab
    
    Someone who finds gitlab mysterious will have no idea what $CI_JOB_NAME
    should be, if they wanted to reproduce the autobuild job manually. It
    should be trivial to include the actual command being run in the logs.
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2381febcfafae30f3e65d7b11e823b92e3cd5ee3
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Feb 14 09:55:45 2019 +1300

    .gitlab-ci.yml: Re-indent comments on test times
    
    (some of these need to be updated, but for now improve the formatting)
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>

commit 20017b57061e1dad6c483eed24d9e996da559f1b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Feb 13 16:43:51 2019 +1300

    .gitlab-ci.yml: Use .extends to avoid duplication of autobuild command
    
    This should make our .gitlab-ci.yml file much less overwealming.
    
    The downside is that $CI_JOB_NAME is printed rather than the job name
    in the log, but the upside is that the names must now strictly match.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>

commit da56644792379b1ead8221233f1b43f55e942202
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Feb 13 16:14:13 2019 +1300

    .gitlab-ci.yml: Fix the registry as "registry.gitlab.com"
    
    This is important as our team docker images are only in this registry, but
    the .gitlab-ci.yml file is also run on other private GitLab hosts.
    
    This partially undoes 8989916b5af6fed9c4c63035d4488583396b8c5a
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>

commit 7dcf51282a53dbdc550e619da7f92f49746217b6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 11 12:53:03 2019 +0100

    .gitlab-ci.yml: add retries on runner_system_failure/stuck_or_timeout_failure
    
    This hopefully avoids pipeline failures due too docker/runner
    errors.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a61e121e1717697210d0f8b62506948c3b86965c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 11 13:26:22 2019 +0100

    .gitlab-ci*.yml: use 'extends: ' instead of YAML Anchors
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 305db94c581ebc59a8080d0569d14b5cbf123499
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 11 12:47:29 2019 +0100

    .gitlab-ci*.yml: remove build_ prefixes
    
    It's useless to see 'builf_samba_ad...' 7 times in the gitlab pipeline summary.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 670413f0f1675b6b6dfbfdcd1c6780824376c8a1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 11 13:23:58 2019 +0100

    .gitlab-ci.yml: print out more information in the before_script section
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 35d66610ca92ddfcff1a4acbc0046459fa246085
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Feb 11 13:18:18 2019 +0100

    script/autobuild.py: add 'lsb_release -a' and 'mount' to system-info.txt
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8c0853b80c4dc0370a8e91796388e4818123f5a6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jan 29 13:57:04 2019 +0100

    selftest:Samba4: wait for DNS names being registered
    
    We can't reliable start tests without registered dns names.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b988695ed7a229f7fe5472bd3ebf257f05524270
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 30 13:44:04 2019 +0100

    selftest:Samba4: report when samba is started and ready
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 19f34b2161dee26ebaee2774b4bee0dc3ce9e340
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 7 09:42:36 2019 +0100

    samba_dnsupdate: make rodc_dns_update() more robust against timing problems
    
    Without this we had an interesting race!
    
    The messaging_dgm code caches connected datagram sockets based on the
    destination pid for 1 second.
    
    The fact that samba_dnsupdate constantly recreates its messaging
    context (and the underlying datagram socket) means that we the winbindd
    messaging context may get a stale connection. As a result sending any
    message from winbindd back to samba_dnsupdate will result in
    ECONNREFUSED.
    
    That means the IRPC response from winbindd never reaches
    samba_dnsupdate, which will then hit a timeout.
    
    In turn samba_dnsupdate on the RODC times out.
    
    This was a workaround for the problem, by having just one global
    IRPC handle and thus just one messaging_dgm context.
    The actual problem is solved a few commits before
    ("messages_dgm: Properly handle receiver re-initialization").
    But we keep this as an performance optimization, which hopefully
    means that the overall samba_dnsupdate is less likely to
    timeout after the hardcoded 20 seconds.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 767e60d97390f90e1b0579d4108ede51a9116952
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 7 09:40:19 2019 +0100

    samba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2f2da0966ba4cf8b2c81dbbfcd09c821b5b953f5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 7 10:07:18 2019 +0100

    winbindd_irpc: remove unused winbind_DsrUpdateReadOnlyServerDnsRecords from wb_irpc_forward_state
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dd3a536b81a8c393e058a2690589cedfffe6e491
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jan 31 08:49:53 2019 +0100

    s4:setup: register ${NTDSGUID}._msdcs.${DNSFOREST} first in dns_update_list
    
    After the A and AAAA records for the ${HOSTNAME} this is the most
    important name.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2543bba0364d8054e9ad316f5611621841bc061d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Feb 7 16:15:46 2019 +0100

    messages_dgm: Properly handle receiver re-initialization
    
    This only properly covers the small-message nonblocking case. Covering
    the large-message and the blocking case is a much larger effort assuming
    we want to re-send the failed message if parts of the message has gone
    through properly. Don't do that for now.
    
    This was found by sanba_dnsupdate constantly recreating its irpc handle to
    winbindd in the RODC case.
    
    The messaging_dgm code cached connected datagram sockets based on the
    destination pid for 1 second. Which means the IRPC responses from
    winbindd are never delivered to samba_dnsupdate,
    which will then hit a timeout.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13786
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8d8f62c4b9dea381ce9f5833bc794553ae358173
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Feb 7 17:48:34 2019 +0100

    torture3: Extend read3 for the "messaging target re-inits" failure
    
    Do ping_pong a hundred times, re-initializing the msg_ctx every time.
    
    https://bugzilla.samba.org/show_bug.cgi?id=13786
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c27afc098398274abaed6dc9bef2019091c1b635
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Feb 7 15:57:06 2019 +0100

    messages_dgm: Use saved errno value
    
    In this case this is just a cleanup, the value has just been set by
    messaging_dgm_sendmsg. But as that already saves errno into a local
    variable, use that.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13786
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 .gitlab-ci-private.yml                |  69 +++++++--------
 .gitlab-ci.yml                        | 154 +++++++++++++++-------------------
 script/autobuild.py                   |   2 +
 selftest/target/Samba4.pm             |  46 ++++++++--
 source3/lib/messages_dgm.c            |  18 +++-
 source3/torture/test_messaging_read.c |  44 +++++-----
 source3/winbindd/winbindd_irpc.c      |   2 -
 source4/scripting/bin/samba_dnsupdate |  22 ++++-
 source4/setup/dns_update_list         |   2 +-
 9 files changed, 201 insertions(+), 158 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci-private.yml b/.gitlab-ci-private.yml
index ea22eaa044f..4a6e5036f80 100644
--- a/.gitlab-ci-private.yml
+++ b/.gitlab-ci-private.yml
@@ -2,44 +2,37 @@ include:
  - '/.gitlab-ci.yml'
 
 
-.private_template: &private_template
-  stage: build
+.private_template:
+  extends: .shared_template
   tags:
     - docker
     - private
-
-build_samba:
-  <<: *private_template
-  script:
-    # this one takes about 4 hours to finish
-    - script/autobuild.py samba            --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-
-build_samba_py2:
-  <<: *private_template
-  script:
-    # this one takes about 4 hours to finish
-    - script/autobuild.py samba-py2            --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-
-build_samba_fileserver:
-  <<: *private_template
-  script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-fileserver --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-
-build_samba_ad_dc:
-  <<: *private_template
-  script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-
-
-build_samba_ad_dc_py2:
-  <<: *private_template
-  script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc-py2     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-
-build_nt4:
-  <<: *private_template
-  script:
-    - script/autobuild.py samba-nt4 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+  before_script:
+    - uname -a
+    - lsb_release -a
+    - mount
+    - df -h
+    - free -h
+
+samba:
+  extends: .private_template
+  # this one takes about 4 hours to finish
+
+samba-py2:
+  extends: .private_template
+  # this one takes about 4 hours to finish
+
+samba-fileserver:
+  extends: .private_template
+  # this one takes about 1 hours to finish
+
+samba-ad-dc:
+  extends: .private_template
+  # this one takes about 1 hours to finish
+
+samba-ad-dc-py2:
+  extends: .private_template
+  # this one takes about 1 hours to finish
+
+samba-nt4:
+  extends: .private_template
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0729599e1b8..53b2acf121f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,24 +2,32 @@
 
 
 variables:
-  SAMBA_BUILD_IMAGES_PROJECT: samba-team/samba
-  SAMBA_BUILD: latest
+  # we run autobuild.py inside a samba CI docker image located on gitlab's registry
+  SAMBA_CI_DOCKER_REGISTRY: registry.gitlab.com
+  SAMBA_CI_DOCKER_NAME: samba-team/samba
+  SAMBA_CI_DOCKER_TAG: latest
+  SAMBA_CI_DOCKER_IMAGE: $SAMBA_CI_DOCKER_REGISTRY/$SAMBA_CI_DOCKER_NAME:$SAMBA_CI_DOCKER_TAG
   GIT_STRATEGY: fetch
   GIT_DEPTH: "3"
 
-.shared_template: &shared_template
-  image: $CI_REGISTRY/$SAMBA_BUILD_IMAGES_PROJECT:$SAMBA_BUILD
+.shared_template:
+  image: $SAMBA_CI_DOCKER_IMAGE
   stage: build
   tags:
     - docker
     - shared
   before_script:
+    - uname -a
+    - lsb_release -a
     - echo "Build starting (preparing swap)..."
     - if [ $(df -m / --output=avail | tail -n1) -gt 10240 ]; then
         sudo dd if=/dev/zero of=/samba-swap bs=1M count=6144;
         sudo mkswap /samba-swap;
         sudo swapon /samba-swap;
       fi
+    - mount
+    - df -h
+    - free -h
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -28,103 +36,79 @@ variables:
       - "*.stderr"
       - system-info.txt
       - /tmp/samba-testbase/*/*/bin/config.log
-
-build_samba_none_env:
-  <<: *shared_template
+  retry:
+    max: 2
+    when:
+      - runner_system_failure
+      - stuck_or_timeout_failure
   script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-none-env    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
+    # autobuild name, which means we can define a default template that runs most autobuild jobs
+    - echo "Running cmd script/autobuild.py $CI_JOB_NAME --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
+    - script/autobuild.py $CI_JOB_NAME    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-build_samba_none_env_py2:
-  <<: *shared_template
+others:
+  extends: .shared_template
   script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-none-env-py2    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-build_samba_nopython:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-nopython   --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-none-env:
+  extends: .shared_template
+  # this one takes about 1 hours to finish
 
-build_samba_systemkrb5:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-systemkrb5 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-none-env-py2:
+  extends: .shared_template
+  # this one takes about 1 hours to finish
 
-build_samba_xc:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-xc         --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-nopython:
+  extends: .shared_template
 
-build_samba_o3:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-o3         --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-systemkrb5:
+  extends: .shared_template
 
-build_samba_ad_dc_2:
-  <<: *shared_template
-  script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc-2     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-xc:
+  extends: .shared_template
 
-build_samba_ad_dc_backup:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-ad-dc-backup    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-o3:
+  extends: .shared_template
 
-build_samba_ad_dc_2_py2:
-  <<: *shared_template
-  script:
-    # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc-2-py2     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-ad-dc-2:
+  extends: .shared_template
+  # this one takes about 1 hours to finish
 
-build_samba_libs:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-libs       --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-ad-dc-backup:
+  extends: .shared_template
 
-build_samba_libs_py2:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-libs-py2       --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-ad-dc-2-py2:
+  extends: .shared_template
+  # this one takes about 1 hours to finish
 
-build_samba_static:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-static     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-libs:
+  extends: .shared_template
 
-build_ctdb:
-  <<: *shared_template
-  script:
-    - script/autobuild.py ctdb       --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-libs-py2:
+  extends: .shared_template
 
-build_samba_ctdb:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-ctdb             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-static:
+  extends: .shared_template
 
-build_others:
-  <<: *shared_template
-  script:
-    - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+ctdb:
+  extends: .shared_template
 
-build_samba_buildpy2_only:
-  <<: *shared_template
-  script:
-    - python script/autobuild.py samba-buildpy2-only             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-ctdb:
+  extends: .shared_template
 
-build_samba_ad_dc_ntvfs:
-  <<: *shared_template
-  script:
-    # this one takes about 100 mins to finish
-    - script/autobuild.py samba-ad-dc-ntvfs --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-buildpy2-only:
+  extends: .shared_template
 
-build_samba_ad_dc_ntvfs_py2:
-  <<: *shared_template
-  script:
-    - script/autobuild.py samba-ad-dc-ntvfs-py2 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+samba-ad-dc-ntvfs:
+  extends: .shared_template
+  # this one takes about 100 mins to finish
+
+samba-ad-dc-ntvfs-py2:
+  extends: .shared_template
diff --git a/script/autobuild.py b/script/autobuild.py
index b1bd9d1686c..b43adcfc33a 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -635,7 +635,9 @@ class buildlist(object):
         filename = 'system-info.txt'
         f = open(filename, 'w')
         for cmd in ['uname -a',
+                    'lsb_release -a',
                     'free',
+                    'mount',
                     'cat /proc/cpuinfo',
                     'cc --version',
                     'df -m .',
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 647e1f14467..179a93ec06c 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -217,9 +217,9 @@ sub wait_for_start($$)
 		$count++;
 	} while ($ret != 0 && $count < 20);
 	if ($count == 20) {
-		warn("nbt not reachable after 20 retries\n");
 		teardown_env($self, $testenv_vars);
-		return 0;
+		warn("nbt not reachable after 20 retries\n");
+		return -1;
 	}
 
 	# Ensure we have the first RID Set before we start tests.  This makes the tests more reliable.
@@ -254,10 +254,11 @@ sub wait_for_start($$)
 		while (system("$cmd >/dev/null") != 0) {
 			$count++;
 			if ($count > $max_wait) {
+				teardown_env($self, $testenv_vars);
 				warn("Timed out ($max_wait sec) waiting for working LDAP and a RID Set to be allocated by $testenv_vars->{NETBIOSNAME} PID $testenv_vars->{SAMBA_PID}");
-				$ret = -1;
-				last;
+				return -1;
 			}
+			print "Waiting for working LDAP...\n";
 			sleep(1);
 		}
 	}
@@ -278,14 +279,45 @@ sub wait_for_start($$)
 		$count++;
 	} while ($ret != 0 && $count < 20);
 	if ($count == 20) {
-		warn("winbind not reachable after 20 retries\n");
 		teardown_env($self, $testenv_vars);
-		return 0;
+		warn("winbind not reachable after 20 retries\n");
+		return -1;
+	}
+
+	# Ensure we registered all our names
+	if ($testenv_vars->{SERVER_ROLE} eq "domain controller") {
+		my $max_wait = 60;
+		print "Waiting for dns_update_cache to be created.\n";
+		$count = 0;
+		while (not -e "$testenv_vars->{PRIVATEDIR}/dns_update_cache") {
+			$count++;
+			if ($count > $max_wait) {
+				teardown_env($self, $testenv_vars);
+				warn("Timed out ($max_wait sec) waiting for dns_update_cache PID $testenv_vars->{SAMBA_PID}");
+				return -1;
+			}
+			print "Waiting for dns_update_cache to be created...\n";
+			sleep(1);
+		}
+		print "Waiting for dns_update_cache to be filled.\n";
+		$count = 0;
+		while ((-s "$testenv_vars->{PRIVATEDIR}/dns_update_cache") == 0) {
+			$count++;
+			if ($count > $max_wait) {
+				teardown_env($self, $testenv_vars);
+				warn("Timed out ($max_wait sec) waiting for dns_update_cache PID $testenv_vars->{SAMBA_PID}");
+				return -1;
+			}
+			print "Waiting for dns_update_cache to be filled...\n";
+			sleep(1);
+		}
 	}
 
 	print $self->getlog_env($testenv_vars);
 
-	return $ret
+	print "READY ($testenv_vars->{SAMBA_PID})\n";
+
+	return 0
 }
 
 sub write_ldb_file($$$)
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 37eefeb0a4a..aaafcc10307 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -553,7 +553,7 @@ static void messaging_dgm_out_threaded_job(void *private_data)
 		if (state->sent != -1) {
 			return;
 		}
-		if (errno != ENOBUFS) {
+		if (state->err != ENOBUFS) {
 			return;
 		}
 
@@ -1419,6 +1419,7 @@ int messaging_dgm_send(pid_t pid,
 	struct messaging_dgm_context *ctx = global_dgm_context;
 	struct messaging_dgm_out *out;
 	int ret;
+	unsigned retries = 0;
 
 	if (ctx == NULL) {
 		return ENOTCONN;
@@ -1426,6 +1427,7 @@ int messaging_dgm_send(pid_t pid,
 
 	messaging_dgm_validate(ctx);
 
+again:
 	ret = messaging_dgm_out_get(ctx, pid, &out);
 	if (ret != 0) {
 		return ret;
@@ -1435,6 +1437,20 @@ int messaging_dgm_send(pid_t pid,
 
 	ret = messaging_dgm_out_send_fragmented(ctx->ev, out, iov, iovlen,
 						fds, num_fds);
+	if (ret == ECONNREFUSED) {
+		/*
+		 * We cache outgoing sockets. If the receiver has
+		 * closed and re-opened the socket since our last
+		 * message, we get connection refused. Retry.
+		 */
+
+		TALLOC_FREE(out);
+
+		if (retries < 5) {
+			retries += 1;
+			goto again;
+		}
+	}
 	return ret;
 }
 
diff --git a/source3/torture/test_messaging_read.c b/source3/torture/test_messaging_read.c
index d3e4079074b..555f084c040 100644
--- a/source3/torture/test_messaging_read.c
+++ b/source3/torture/test_messaging_read.c
@@ -250,14 +250,13 @@ fail:
 }
 
 struct msg_pingpong_state {
-	uint8_t dummy;
+	struct messaging_context *msg_ctx;
 };
 
 static void msg_pingpong_done(struct tevent_req *subreq);
 
 static struct tevent_req *msg_pingpong_send(TALLOC_CTX *mem_ctx,
 					    struct tevent_context *ev,
-					    struct messaging_context *msg_ctx,
 					    struct server_id dst)
 {
 	struct tevent_req *req, *subreq;
@@ -269,13 +268,23 @@ static struct tevent_req *msg_pingpong_send(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	status = messaging_send_buf(msg_ctx, dst, MSG_PING, NULL, 0);
+	if (!tevent_req_set_endtime(req, ev, timeval_current_ofs(10, 0))) {
+		return tevent_req_post(req, ev);
+	}
+
+	state->msg_ctx = messaging_init(state, ev);
+	if (tevent_req_nomem(state->msg_ctx, req)) {
+		return tevent_req_post(req, ev);
+	}
+
+	status = messaging_send_buf(state->msg_ctx, dst, MSG_PING, NULL, 0);
 	if (!NT_STATUS_IS_OK(status)) {
+		DBG_DEBUG("messaging_send_buf failed: %s\n", nt_errstr(status));
 		tevent_req_error(req, map_errno_from_nt_status(status));
 		return tevent_req_post(req, ev);
 	}
 
-	subreq = messaging_read_send(state, ev, msg_ctx, MSG_PONG);
+	subreq = messaging_read_send(state, ev, state->msg_ctx, MSG_PONG);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
@@ -308,18 +317,17 @@ static int msg_pingpong_recv(struct tevent_req *req)
 	return 0;
 }
 
-static int msg_pingpong(struct messaging_context *msg_ctx,
-			struct server_id dst)
+static int msg_pingpong(struct server_id dst)
 {
 	struct tevent_context *ev;
 	struct tevent_req *req;
 	int ret = ENOMEM;
 
-	ev = tevent_context_init(msg_ctx);
+	ev = tevent_context_init(talloc_tos());
 	if (ev == NULL) {
 		goto fail;
 	}
-	req = msg_pingpong_send(ev, ev, msg_ctx, dst);
+	req = msg_pingpong_send(ev, ev, dst);
 	if (req == NULL) {
 		goto fail;
 	}
@@ -398,7 +406,7 @@ bool run_messaging_read3(int dummy)
 	pid_t child;
 	int ready_pipe[2];
 	int exit_pipe[2];
-	int ret;
+	int i, ret;
 	char c;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list