[PATCH] Add two more tests for substitutions

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
Hi,

attached are two tests to tests substitutions for the share path name and also
the 'template homedir'.


Review and push much appreciated!


Thanks,


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

tests.patch (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
On Wed, Mar 15, 2017 at 01:12:12PM +0100, Andreas Schneider via samba-technical wrote:
> Hi,
>
> attached are two tests to tests substitutions for the share path name and also
> the 'template homedir'.
>
>
> Review and push much appreciated!

Great work Andreas, thanks for these ! RB+ and pushed.

> Thanks,
>
>
> Andreas
>
> --
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             [hidden email]
> www.samba.org

> From 4b98c3a9f8764f49a2e2320f923edbff3bce7bd4 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <[hidden email]>
> Date: Wed, 15 Mar 2017 12:37:08 +0100
> Subject: [PATCH 1/2] s3:tests: Add a subsitution test for %D %u %g
>
> Signed-off-by: Andreas Schneider <[hidden email]>
> ---
>  selftest/target/Samba3.pm                  | 19 ++++++++++++++++++-
>  source3/script/tests/test_substitutions.sh |  9 +++++++--
>  2 files changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
> index d754b5f9ac1..d56b35e97ba 100755
> --- a/selftest/target/Samba3.pm
> +++ b/selftest/target/Samba3.pm
> @@ -394,16 +394,33 @@ sub setup_admember($$$$)
>   $substitution_path = "$share_dir/D_SAMBADOMAIN/U_alice/G_domain users";
>   push(@dirs, $substitution_path);
>  
> + # Using '/' as the winbind separator is a bad idea ...
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN";
> + push(@dirs, $substitution_path);
> +
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice";
> + push(@dirs, $substitution_path);
> +
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN";
> + push(@dirs, $substitution_path);
> +
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN/domain users";
> + push(@dirs, $substitution_path);
> +
>   my $member_options = "
>   security = ads
>          workgroup = $dcvars->{DOMAIN}
>          realm = $dcvars->{REALM}
>          netbios aliases = foo bar
>  
> -[subDUG]
> +[sub_dug]
>   path = $share_dir/D_%D/U_%U/G_%G
>   writeable = yes
>  
> +[sub_dug2]
> + path = $share_dir/D_%D/u_%u/g_%g
> + writeable = yes
> +
>  ";
>  
>   my $ret = $self->provision($prefix,
> diff --git a/source3/script/tests/test_substitutions.sh b/source3/script/tests/test_substitutions.sh
> index 0852ad969f0..1a46f11c85d 100755
> --- a/source3/script/tests/test_substitutions.sh
> +++ b/source3/script/tests/test_substitutions.sh
> @@ -24,9 +24,14 @@ smbclient="$samba_bindir/smbclient"
>  . $samba_srcdir/testprogs/blackbox/subunit.sh
>  . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
>  
> -SMB_UNC="//$SERVER/subDUG"
> +SMB_UNC="//$SERVER/sub_dug"
>  
> -test_smbclient "Test login to share with substitution" \
> +test_smbclient "Test login to share with substitution (DUG)" \
> + "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
> +
> +SMB_UNC="//$SERVER/sub_dug2"
> +
> +test_smbclient "Test login to share with substitution (Dug)" \
>   "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
>  
>  exit $failed
> --
> 2.12.0
>
>
> From 86c9c428bf873d1c1da25ce4c4e5f673fb1d51b3 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <[hidden email]>
> Date: Wed, 15 Mar 2017 13:04:43 +0100
> Subject: [PATCH 2/2] s3:tests: Also test the substitution of 'template
>  homedir'
>
> Signed-off-by: Andreas Schneider <[hidden email]>
> ---
>  selftest/target/Samba3.pm                  |  1 +
>  source3/script/tests/test_substitutions.sh | 26 +++++++++++++++++++-------
>  source3/selftest/tests.py                  |  2 +-
>  3 files changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
> index d56b35e97ba..74997b43c8f 100755
> --- a/selftest/target/Samba3.pm
> +++ b/selftest/target/Samba3.pm
> @@ -412,6 +412,7 @@ sub setup_admember($$$$)
>          workgroup = $dcvars->{DOMAIN}
>          realm = $dcvars->{REALM}
>          netbios aliases = foo bar
> + template homedir = /home/%D/%G/%U
>  
>  [sub_dug]
>   path = $share_dir/D_%D/U_%U/G_%G
> diff --git a/source3/script/tests/test_substitutions.sh b/source3/script/tests/test_substitutions.sh
> index 1a46f11c85d..5620097c22a 100755
> --- a/source3/script/tests/test_substitutions.sh
> +++ b/source3/script/tests/test_substitutions.sh
> @@ -5,33 +5,45 @@
>  
>  if [ $# -lt 4 ]; then
>  cat <<EOF
> -Usage: test_substitutions.sh SERVER USERNAME PASSWORD PREFIX
> +Usage: test_substitutions.sh SERVER DOMAIN USERNAME PASSWORD PREFIX
>  EOF
>  exit 1;
>  fi
>  
>  SERVER=$1
> -USERNAME=$2
> -PASSWORD=$3
> -PREFIX=$4
> -shift 4
> +DOMAIN=$2
> +USERNAME=$3
> +PASSWORD=$4
> +PREFIX=$5
> +shift 5
>  failed=0
>  
>  samba_bindir="$BINDIR"
>  samba_srcdir="$SRCDIR"
>  smbclient="$samba_bindir/smbclient"
> +wbinfo="$samba_bindir/wbinfo"
>  
>  . $samba_srcdir/testprogs/blackbox/subunit.sh
>  . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
>  
> +test_wbinfo_template_homedir()
> +{
> + user="$1"
> + shift
> +
> + $wbinfo -i $user | grep "/home/$DOMAIN/Domain Users/alice"
> +}
> +
>  SMB_UNC="//$SERVER/sub_dug"
>  
> -test_smbclient "Test login to share with substitution (DUG)" \
> +test_smbclient "Test login to share with substitution (sub_dug)" \
>   "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
>  
>  SMB_UNC="//$SERVER/sub_dug2"
>  
> -test_smbclient "Test login to share with substitution (Dug)" \
> +test_smbclient "Test login to share with substitution (sub_dug2)" \
>   "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
>  
> +testit "wbinfo -i $DOMAIN+alice" test_wbinfo_template_homedir $DOMAIN/alice || failed=$(expr $failed + 1)
> +
>  exit $failed
> diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
> index 54f5b7baa03..436576229ac 100755
> --- a/source3/selftest/tests.py
> +++ b/source3/selftest/tests.py
> @@ -181,7 +181,7 @@ t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
>  plantestsuite("samba3.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
>  t = "WBCLIENT-MULTI-PING"
>  plantestsuite("samba3.smbtorture_s3.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
> -plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "alice", "Secret007", "$PREFIX"])
> +plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "$DOMAIN", "alice", "Secret007", "$PREFIX"])
>  
>  plantestsuite("samba3.ntlm_auth.krb5 with old ccache(ktest:local)", "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_krb5.sh"), valgrindify(python), samba3srcdir, ntlm_auth3, '$PREFIX/ktest/krb5_ccache-2', '$SERVER', configuration])
>  
> --
> 2.12.0
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
On Wed, Mar 15, 2017 at 10:53:08AM -0700, Jeremy Allison via samba-technical wrote:

> On Wed, Mar 15, 2017 at 01:12:12PM +0100, Andreas Schneider via samba-technical wrote:
> > Hi,
> >
> > attached are two tests to tests substitutions for the share path name and also
> > the 'template homedir'.
> >
> >
> > Review and push much appreciated!
>
> Great work Andreas, thanks for these ! RB+ and pushed.

Andreas, I'm getting an autobuild fail on these with:

Can you look into this ?

Sorry,

Jeremy.

[639(3340)/2043 at 49m8s] samba3.local.nss(ad_member:local)
smbtorture 4.7.0pre1-DEVELOPERBUILD
Using seed 1489623044
Testing setpwent
Testing getpwent
nobody:x:65533:65534:nobody gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
jra:x:1016:100:jra gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
pdbtest:x:65532:65533:pdbtest gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
pdbtest2:x:65531:65533:pdbtest gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
userdup:x:65530:65529:userdup gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
pdbtest_wkn:x:65529:65528:pdbtest_wkn gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
force_user:x:65528:65527:force user gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
smbget_user:x:65527:65531:smbget_user gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
user1:x:65526:65533:user1 gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
user2:x:65525:65533:user2 gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
root:x:65534:65532:root gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwent
SAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/Domain Users/administrator:/bin/false
Testing getpwent
SAMBADOMAIN/testallowed account:*:100003:100006::/home/SAMBADOMAIN/Domain Users/testallowed account:/bin/false
Testing getpwent
SAMBADOMAIN/testdenied:*:100004:100006::/home/SAMBADOMAIN/Domain Users/testdenied:/bin/false
Testing getpwent
SAMBADOMAIN/krbtgt:*:100005:100006::/home/SAMBADOMAIN/Domain Users/krbtgt:/bin/false
Testing getpwent
SAMBADOMAIN/guest:*:100006:100006::/home/SAMBADOMAIN/Domain Users/guest:/bin/false
Testing getpwent
SAMBADOMAIN/alice:*:100002:100006::/home/SAMBADOMAIN//home/SAMBADOMAIN/_G/_U/alice:/bin/false
Testing getpwent
SAMBADOMAIN/bob:*:100007:100006::/home/SAMBADOMAIN/Domain Users/bob:/bin/false
Testing endpwent
Testing getpwnam: nobody
Testing getpwuid: 65533
nobody:x:65533:65534:nobody gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: jra
Testing getpwuid: 1016
jra:x:1016:100:jra gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: pdbtest
Testing getpwuid: 65532
pdbtest:x:65532:65533:pdbtest gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: pdbtest2
Testing getpwuid: 65531
pdbtest2:x:65531:65533:pdbtest gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: userdup
Testing getpwuid: 65530
userdup:x:65530:65529:userdup gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: pdbtest_wkn
Testing getpwuid: 65529
pdbtest_wkn:x:65529:65528:pdbtest_wkn gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: force_user
Testing getpwuid: 65528
force_user:x:65528:65527:force user gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: smbget_user
Testing getpwuid: 65527
smbget_user:x:65527:65531:smbget_user gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: user1
Testing getpwuid: 65526
user1:x:65526:65533:user1 gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: user2
Testing getpwuid: 65525
user2:x:65525:65533:user2 gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: root
Testing getpwuid: 65534
root:x:65534:65532:root gecos:/memdisk/jra/a/b313275/samba/bin/ab/ad_member:/bin/false
Testing getpwnam: SAMBADOMAIN/administrator
Testing getpwuid: 100001
SAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/Domain Users/administrator:/bin/false
Testing getpwnam: SAMBADOMAIN/testallowed account
Testing getpwuid: 100003
SAMBADOMAIN/testallowed account:*:100003:100006::/home/SAMBADOMAIN/Domain Users/testallowed account:/bin/false
Testing getpwnam: SAMBADOMAIN/testdenied
Testing getpwuid: 100004
SAMBADOMAIN/testdenied:*:100004:100006::/home/SAMBADOMAIN/Domain Users/testdenied:/bin/false
Testing getpwnam: SAMBADOMAIN/krbtgt
Testing getpwuid: 100005
SAMBADOMAIN/krbtgt:*:100005:100006::/home/SAMBADOMAIN/Domain Users/krbtgt:/bin/false
Testing getpwnam: SAMBADOMAIN/guest
Testing getpwuid: 100006
SAMBADOMAIN/guest:*:100006:100006::/home/SAMBADOMAIN/Domain Users/guest:/bin/false
Testing getpwnam: SAMBADOMAIN/alice
WARNING!: ../source4/torture/local/nss_tests.c:395: p1->pw_dir was /home/SAMBADOMAIN//home/SAMBADOMAIN/_G/_U/alice, expected /home/SAMBADOMAIN/Domain Users/alice: getpwent and getpwnam gave different results
WARNING!: ../source4/torture/local/nss_tests.c:415: Expression `torture_assert_passwd_equal(tctx, &pwd[i], &pwd1, "getpwent and getpwnam gave different results")' failed: ../source4/torture/local/nss_tests.c:415
UNEXPECTED(failure): samba3.local.nss.enumeration(ad_member:local)
REASON: Exception: Exception: ../source4/torture/local/nss_tests.c:853: Expression `test_passwd(tctx)' failed: failed to test users


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
On Thursday, 16 March 2017 01:16:31 CET Jeremy Allison wrote:
> On Wed, Mar 15, 2017 at 10:53:08AM -0700, Jeremy Allison via samba-technical
wrote:
> > On Wed, Mar 15, 2017 at 01:12:12PM +0100, Andreas Schneider via samba-
technical wrote:

> > > Hi,
> > >
> > > attached are two tests to tests substitutions for the share path name
> > > and also the 'template homedir'.
> > >
> > >
> > > Review and push much appreciated!
> >
> > Great work Andreas, thanks for these ! RB+ and pushed.
>
> Andreas, I'm getting an autobuild fail on these with:
>
> Can you look into this ?
>
> Sorry,
Don't be sorry, this actually reveals a real bug! I opened:


        https://bugzilla.samba.org/show_bug.cgi?id=12699


Could also be a regression, but I'm not sure!


The attached patchset addresses the issue.


Please review again.


Thanks,


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

subs.patch (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
On Friday, 17 March 2017 12:12:33 CET Andreas Schneider via samba-technical
wrote:

> On Thursday, 16 March 2017 01:16:31 CET Jeremy Allison wrote:
> > On Wed, Mar 15, 2017 at 10:53:08AM -0700, Jeremy Allison via
> > samba-technical
> wrote:
> > > On Wed, Mar 15, 2017 at 01:12:12PM +0100, Andreas Schneider via samba-
>
> technical wrote:
> > > > Hi,
> > > >
> > > > attached are two tests to tests substitutions for the share path name
> > > > and also the 'template homedir'.
> > > >
> > > >
> > > > Review and push much appreciated!
> > >
> > > Great work Andreas, thanks for these ! RB+ and pushed.
> >
> > Andreas, I'm getting an autobuild fail on these with:
> >
> > Can you look into this ?
> >
> > Sorry,
>
> Don't be sorry, this actually reveals a real bug! I opened:
>
>
> https://bugzilla.samba.org/show_bug.cgi?id=12699
>
>
> Could also be a regression, but I'm not sure!
>
>
> The attached patchset addresses the issue.
>
>
> Please review again.
I've looked into it with Volker and he spotted the correct fix. See
attachment.


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

subs_v2.patch (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
On Fri, Mar 17, 2017 at 03:09:52PM +0100, Andreas Schneider via samba-technical wrote:

> On Friday, 17 March 2017 12:12:33 CET Andreas Schneider via samba-technical
> wrote:
> > On Thursday, 16 March 2017 01:16:31 CET Jeremy Allison wrote:
> > > On Wed, Mar 15, 2017 at 10:53:08AM -0700, Jeremy Allison via
> > > samba-technical
> > wrote:
> > > > On Wed, Mar 15, 2017 at 01:12:12PM +0100, Andreas Schneider via samba-
> >
> > technical wrote:
> > > > > Hi,
> > > > >
> > > > > attached are two tests to tests substitutions for the share path name
> > > > > and also the 'template homedir'.
> > > > >
> > > > >
> > > > > Review and push much appreciated!
> > > >
> > > > Great work Andreas, thanks for these ! RB+ and pushed.
> > >
> > > Andreas, I'm getting an autobuild fail on these with:
> > >
> > > Can you look into this ?
> > >
> > > Sorry,
> >
> > Don't be sorry, this actually reveals a real bug! I opened:
> >
> >
> > https://bugzilla.samba.org/show_bug.cgi?id=12699
> >
> >
> > Could also be a regression, but I'm not sure!
> >
> >
> > The attached patchset addresses the issue.
> >
> >
> > Please review again.
>
> I've looked into it with Volker and he spotted the correct fix. See
> attachment.

Pushed, thanks!

Volker

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Fri, Mar 17, 2017 at 03:09:52PM +0100, Andreas Schneider via samba-technical wrote:

> On Friday, 17 March 2017 12:12:33 CET Andreas Schneider via samba-technical
> wrote:
> > On Thursday, 16 March 2017 01:16:31 CET Jeremy Allison wrote:
> > > On Wed, Mar 15, 2017 at 10:53:08AM -0700, Jeremy Allison via
> > > samba-technical
> > wrote:
> > > > On Wed, Mar 15, 2017 at 01:12:12PM +0100, Andreas Schneider via samba-
> >
> > technical wrote:
> > > > > Hi,
> > > > >
> > > > > attached are two tests to tests substitutions for the share path name
> > > > > and also the 'template homedir'.
> > > > >
> > > > >
> > > > > Review and push much appreciated!
> > > >
> > > > Great work Andreas, thanks for these ! RB+ and pushed.
> > >
> > > Andreas, I'm getting an autobuild fail on these with:
> > >
> > > Can you look into this ?
> > >
> > > Sorry,
> >
> > Don't be sorry, this actually reveals a real bug! I opened:
> >
> >
> > https://bugzilla.samba.org/show_bug.cgi?id=12699
> >
> >
> > Could also be a regression, but I'm not sure!
> >
> >
> > The attached patchset addresses the issue.
> >
> >
> > Please review again.
>
> I've looked into it with Volker and he spotted the correct fix. See
> attachment.

Oh good catch ! RB+.

>
> --
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             [hidden email]
> www.samba.org

> From 090d3986da4ab346a40e3651b9f3e449705d7bbb Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <[hidden email]>
> Date: Fri, 17 Mar 2017 13:52:57 +0100
> Subject: [PATCH 1/4] s3:winbind: Use the correct talloc context for user
>  information
>
> This fixes the substitution for 'template homedir'.
>
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
>
> Signed-off-by: Volker Lendecke <[hidden email]>
> Reviewed-by: Andreas Schneider <[hidden email]>
> ---
>  source3/winbindd/wb_queryuser.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
> index be4d3d3e665..69b4c8dad5a 100644
> --- a/source3/winbindd/wb_queryuser.c
> +++ b/source3/winbindd/wb_queryuser.c
> @@ -329,7 +329,7 @@ static void wb_queryuser_got_group_name(struct tevent_req *subreq)
>   NTSTATUS status;
>   const char *domain_name;
>  
> - status = wb_lookupsid_recv(subreq, state, &type, &domain_name,
> + status = wb_lookupsid_recv(subreq, state->info, &type, &domain_name,
>     &state->info->primary_group_name);
>   TALLOC_FREE(subreq);
>   if (tevent_req_nterror(req, status)) {
> --
> 2.12.0
>
>
> From 7ca3a549814a9dedf805d7a3eeb21ec3f8e0b7e1 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <[hidden email]>
> Date: Fri, 17 Mar 2017 10:04:19 +0100
> Subject: [PATCH 2/4] selftest: Define template homedir for 'ad_member' env
>
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
>
> With this set, the samba3.local.nss test for ad_member will ensure that
> we correctly substitute those smb.conf options.
>
> Signed-off-by: Andreas Schneider <[hidden email]>
> ---
>  selftest/target/Samba3.pm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
> index d754b5f9ac1..79699f053bb 100755
> --- a/selftest/target/Samba3.pm
> +++ b/selftest/target/Samba3.pm
> @@ -399,6 +399,7 @@ sub setup_admember($$$$)
>          workgroup = $dcvars->{DOMAIN}
>          realm = $dcvars->{REALM}
>          netbios aliases = foo bar
> + template homedir = /home/%D/%G/%U
>  
>  [subDUG]
>   path = $share_dir/D_%D/U_%U/G_%G
> --
> 2.12.0
>
>
> From 247344da3c3e33f416ef8e6d010907bc1a9bc196 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <[hidden email]>
> Date: Wed, 15 Mar 2017 12:37:08 +0100
> Subject: [PATCH 3/4] s3:tests: Add a subsitution test for %D %u %g
>
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
>
> Signed-off-by: Andreas Schneider <[hidden email]>
> ---
>  selftest/target/Samba3.pm                  | 19 ++++++++++++++++++-
>  source3/script/tests/test_substitutions.sh |  9 +++++++--
>  2 files changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
> index 79699f053bb..74997b43c8f 100755
> --- a/selftest/target/Samba3.pm
> +++ b/selftest/target/Samba3.pm
> @@ -394,6 +394,19 @@ sub setup_admember($$$$)
>   $substitution_path = "$share_dir/D_SAMBADOMAIN/U_alice/G_domain users";
>   push(@dirs, $substitution_path);
>  
> + # Using '/' as the winbind separator is a bad idea ...
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN";
> + push(@dirs, $substitution_path);
> +
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice";
> + push(@dirs, $substitution_path);
> +
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN";
> + push(@dirs, $substitution_path);
> +
> + $substitution_path = "$share_dir/D_SAMBADOMAIN/u_SAMBADOMAIN/alice/g_SAMBADOMAIN/domain users";
> + push(@dirs, $substitution_path);
> +
>   my $member_options = "
>   security = ads
>          workgroup = $dcvars->{DOMAIN}
> @@ -401,10 +414,14 @@ sub setup_admember($$$$)
>          netbios aliases = foo bar
>   template homedir = /home/%D/%G/%U
>  
> -[subDUG]
> +[sub_dug]
>   path = $share_dir/D_%D/U_%U/G_%G
>   writeable = yes
>  
> +[sub_dug2]
> + path = $share_dir/D_%D/u_%u/g_%g
> + writeable = yes
> +
>  ";
>  
>   my $ret = $self->provision($prefix,
> diff --git a/source3/script/tests/test_substitutions.sh b/source3/script/tests/test_substitutions.sh
> index 0852ad969f0..1a46f11c85d 100755
> --- a/source3/script/tests/test_substitutions.sh
> +++ b/source3/script/tests/test_substitutions.sh
> @@ -24,9 +24,14 @@ smbclient="$samba_bindir/smbclient"
>  . $samba_srcdir/testprogs/blackbox/subunit.sh
>  . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
>  
> -SMB_UNC="//$SERVER/subDUG"
> +SMB_UNC="//$SERVER/sub_dug"
>  
> -test_smbclient "Test login to share with substitution" \
> +test_smbclient "Test login to share with substitution (DUG)" \
> + "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
> +
> +SMB_UNC="//$SERVER/sub_dug2"
> +
> +test_smbclient "Test login to share with substitution (Dug)" \
>   "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
>  
>  exit $failed
> --
> 2.12.0
>
>
> From cf0221b055e8a662c943870f9a11ac96edd34d7d Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <[hidden email]>
> Date: Wed, 15 Mar 2017 13:04:43 +0100
> Subject: [PATCH 4/4] s3:tests: Add another test to verify substitution of
>  'template homedir'
>
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12699
>
> Signed-off-by: Andreas Schneider <[hidden email]>
> ---
>  source3/script/tests/test_substitutions.sh | 26 +++++++++++++++++++-------
>  source3/selftest/tests.py                  |  2 +-
>  2 files changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/source3/script/tests/test_substitutions.sh b/source3/script/tests/test_substitutions.sh
> index 1a46f11c85d..5620097c22a 100755
> --- a/source3/script/tests/test_substitutions.sh
> +++ b/source3/script/tests/test_substitutions.sh
> @@ -5,33 +5,45 @@
>  
>  if [ $# -lt 4 ]; then
>  cat <<EOF
> -Usage: test_substitutions.sh SERVER USERNAME PASSWORD PREFIX
> +Usage: test_substitutions.sh SERVER DOMAIN USERNAME PASSWORD PREFIX
>  EOF
>  exit 1;
>  fi
>  
>  SERVER=$1
> -USERNAME=$2
> -PASSWORD=$3
> -PREFIX=$4
> -shift 4
> +DOMAIN=$2
> +USERNAME=$3
> +PASSWORD=$4
> +PREFIX=$5
> +shift 5
>  failed=0
>  
>  samba_bindir="$BINDIR"
>  samba_srcdir="$SRCDIR"
>  smbclient="$samba_bindir/smbclient"
> +wbinfo="$samba_bindir/wbinfo"
>  
>  . $samba_srcdir/testprogs/blackbox/subunit.sh
>  . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
>  
> +test_wbinfo_template_homedir()
> +{
> + user="$1"
> + shift
> +
> + $wbinfo -i $user | grep "/home/$DOMAIN/Domain Users/alice"
> +}
> +
>  SMB_UNC="//$SERVER/sub_dug"
>  
> -test_smbclient "Test login to share with substitution (DUG)" \
> +test_smbclient "Test login to share with substitution (sub_dug)" \
>   "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
>  
>  SMB_UNC="//$SERVER/sub_dug2"
>  
> -test_smbclient "Test login to share with substitution (Dug)" \
> +test_smbclient "Test login to share with substitution (sub_dug2)" \
>   "ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
>  
> +testit "wbinfo -i $DOMAIN+alice" test_wbinfo_template_homedir $DOMAIN/alice || failed=$(expr $failed + 1)
> +
>  exit $failed
> diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
> index 54f5b7baa03..436576229ac 100755
> --- a/source3/selftest/tests.py
> +++ b/source3/selftest/tests.py
> @@ -181,7 +181,7 @@ t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
>  plantestsuite("samba3.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
>  t = "WBCLIENT-MULTI-PING"
>  plantestsuite("samba3.smbtorture_s3.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
> -plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "alice", "Secret007", "$PREFIX"])
> +plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "$DOMAIN", "alice", "Secret007", "$PREFIX"])
>  
>  plantestsuite("samba3.ntlm_auth.krb5 with old ccache(ktest:local)", "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_krb5.sh"), valgrindify(python), samba3srcdir, ntlm_auth3, '$PREFIX/ktest/krb5_ccache-2', '$SERVER', configuration])
>  
> --
> 2.12.0
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Fri, Mar 17, 2017 at 03:27:30PM +0100, Volker Lendecke wrote:
> > I've looked into it with Volker and he spotted the correct fix. See
> > attachment.
>
> Pushed, thanks!

The tests fail with

[2023(14247)/2043 at 3h9m31s] samba.blackbox.wbinfo(ad_member:local)(ad_member:local)
/memdisk/vlendec/a/b554478/samba/source4/../nsswitch/tests/test_wbinfo.sh:
211: test:
xSAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/Domain:
unexpected operator
UNEXPECTED(failure): samba.blackbox.wbinfo(ad_member:local).confirm
output of wbinfo -i against ad_member(ad_member:local)
REASON: Exception: Exception: expected
'SAMBADOMAIN/administrator:*:100001:100006:Administrator:/home/SAMBADOMAIN/administrator:/bin/false'
or
'SAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/administrator:/bin/false'
got
'SAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/Domain
Users/administrator:/bin/false'

FAILED (1 failures, 0 errors and 0 unexpected successes in 0
testsuites)

I've pushed the talloc hierarchy fix now independently. Can you check
your tests succeed autobuild?

Thanks, Volker

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
On Saturday, 18 March 2017 16:03:57 CET Volker Lendecke wrote:
> I've pushed the talloc hierarchy fix now independently. Can you check
> your tests succeed autobuild?
>
> Thanks, Volker

Sorry, here is a new patchset.


Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

subs_v3.patch (117 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] Add two more tests for substitutions

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Saturday, 18 March 2017 16:03:57 CET Volker Lendecke via samba-technical
wrote:

> On Fri, Mar 17, 2017 at 03:27:30PM +0100, Volker Lendecke wrote:
> > > I've looked into it with Volker and he spotted the correct fix. See
> > > attachment.
> >
> > Pushed, thanks!
>
> The tests fail with
>
> [2023(14247)/2043 at 3h9m31s]
> samba.blackbox.wbinfo(ad_member:local)(ad_member:local)
> /memdisk/vlendec/a/b554478/samba/source4/../nsswitch/tests/test_wbinfo.sh:
> 211: test:
> xSAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/Domain:
> unexpected operator
> UNEXPECTED(failure): samba.blackbox.wbinfo(ad_member:local).confirm
> output of wbinfo -i against ad_member(ad_member:local)
> REASON: Exception: Exception: expected
> 'SAMBADOMAIN/administrator:*:100001:100006:Administrator:/home/SAMBADOMAIN/a
> dministrator:/bin/false' or
> 'SAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/administrator:
> /bin/false' got
> 'SAMBADOMAIN/administrator:*:100001:100006::/home/SAMBADOMAIN/Domain
> Users/administrator:/bin/false'
>
> FAILED (1 failures, 0 errors and 0 unexpected successes in 0
> testsuites)
>
> I've pushed the talloc hierarchy fix now independently. Can you check
> your tests succeed autobuild?
>
> Thanks, Volker
Forgot --stdout ...


--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

subs_v4.patch (5K) Download Attachment
Loading...