[PATCH] Add test for 'net ads (join|leave)

Uri Simchoni urisimchoni at gmail.com
Sat Oct 31 05:13:53 UTC 2015


Strange..  I did a make test on the original as well as the modified patch.
I will have a look later.
בתאריך 31 באוק 2015 07:04,‏ "Jeremy Allison" <jra at samba.org> כתב:

> On Wed, Oct 28, 2015 at 11:05:23AM +0200, Uri Simchoni wrote:
> > How about adding a testjoin with machine account as well (see attached)?
> > Otherwise RB+ me.
>
> FYI. Tried to push this but got:
>
> /memdisk/jra/a/b24596/samba/testprogs/blackbox/test_net_ads.sh: 17:
> source: not found
>
> in the autobuild fail. I think this line:
>
> +source `dirname $0`/subunit.sh
>
> is incorrect. subunit.sh is found in testprogs/blackbox/
> so it looks right, but something isn't working in autobuild.
>
> Jeremy.
>
> > From 8eb189ecdfd633ff3fa8c8ecd9e673be4b18fc07 Mon Sep 17 00:00:00 2001
> > From: Andreas Schneider <asn at samba.org>
> > Date: Tue, 20 Oct 2015 15:54:39 +0200
> > Subject: [PATCH] tests: Add tests for net ads (join|leave)
> >
> > Signed-off-by: Andreas Schneider <asn at samba.org>
> > ---
> >  source4/selftest/tests.py          |  1 +
> >  testprogs/blackbox/test_net_ads.sh | 35
> +++++++++++++++++++++++++++++++++++
> >  2 files changed, 36 insertions(+)
> >  create mode 100755 testprogs/blackbox/test_net_ads.sh
> >
> > diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
> > index acacadb..1425323 100755
> > --- a/source4/selftest/tests.py
> > +++ b/source4/selftest/tests.py
> > @@ -330,6 +330,7 @@
> plantestsuite("samba4.blackbox.gentest(ad_dc_ntvfs)", "ad_dc_ntvfs", [
> os.path.jo
> >  plantestsuite("samba4.blackbox.rfc2307_mapping(ad_dc_ntvfs:local)",
> "ad_dc_ntvfs:local", [os.path.join(samba4srcdir,
> "../nsswitch/tests/test_rfc2307_mapping.sh"), '$DOMAIN', '$USERNAME',
> '$PASSWORD', "$SERVER", "$UID_RFC2307TEST", "$GID_RFC2307TEST",
> configuration])
> >  plantestsuite("samba4.blackbox.chgdcpass", "chgdcpass",
> [os.path.join(bbdir, "test_chgdcpass.sh"), '$SERVER', "CHGDCPASS\$",
> '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96",
> '$SELFTEST_PREFIX/chgdcpass', smbclient4])
> >  plantestsuite("samba4.blackbox.samba_upgradedns(chgdcpass:local)",
> "chgdcpass:local", [os.path.join(bbdir, "test_samba_upgradedns.sh"),
> '$SERVER', '$REALM', '$PREFIX', '$SELFTEST_PREFIX/chgdcpass'])
> > +plantestsuite("samba4.blackbox.net_ads(ad_member:local)",
> "ad_member:local", [os.path.join(bbdir, "test_net_ads.sh"), '$DC_SERVER',
> '$DC_USERNAME', '$DC_PASSWORD'])
> >  plantestsuite_loadlist("samba4.rpc.echo against NetBIOS alias",
> "ad_dc_ntvfs", [valgrindify(smbtorture4), "$LISTOPT", "$LOADLIST",
> 'ncacn_np:$NETBIOSALIAS', '-U$DOMAIN/$USERNAME%$PASSWORD', 'rpc.echo'])
> >
> >  # Tests using the "Simple" NTVFS backend
> > diff --git a/testprogs/blackbox/test_net_ads.sh
> b/testprogs/blackbox/test_net_ads.sh
> > new file mode 100755
> > index 0000000..b3a7dab
> > --- /dev/null
> > +++ b/testprogs/blackbox/test_net_ads.sh
> > @@ -0,0 +1,35 @@
> > +if [ $# -lt 3 ]; then
> > +cat <<EOF
> > +Usage: test_net.sh SERVER USERNAME PASSWORD
> > +EOF
> > +exit 1;
> > +fi
> > +
> > +DC_SERVER=$1
> > +DC_USERNAME=$2
> > +DC_PASSWORD=$3
> > +
> > +failed=0
> > +
> > +net_tool="$BINDIR/net"
> > +
> > +# Load test functions
> > +source `dirname $0`/subunit.sh
> > +
> > +testit "leave" $VALGRIND $net_tool ads leave
> -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1`
> > +
> > +testit "join+server" $VALGRIND $net_tool ads join
> -U$DC_USERNAME%$DC_PASSWORD -S$DC_SERVER || failed=`expr $failed + 1`
> > +
> > +testit "leave+server" $VALGRIND $net_tool ads leave
> -U$DC_USERNAME%$DC_PASSWORD -S$DC_SERVER || failed=`expr $failed + 1`
> > +
> > +testit_expect_failure "join+invalid_server" $VALGRIND $net_tool ads
> join -U$DC_USERNAME%$DC_PASSWORD -SINVALID && failed=`expr $failed + 1`
> > +
> > +testit "join+server" $VALGRIND $net_tool ads join
> -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1`
> > +
> > +testit_expect_failure "leave+invalid_server" $VALGRIND $net_tool ads
> leave -U$DC_USERNAME%$DC_PASSWORD -SINVALID && failed=`expr $failed + 1`
> > +
> > +testit "testjoin" $VALGRIND $net_tool ads testjoin
> -U$DC_USERNAME%$DC_PASSWORD || failed=`expr $failed + 1`
> > +
> > +testit "testjoin_machine_account" $VALGRIND $net_tool ads testjoin -kP
> || failed=`expr $failed + 1`
> > +
> > +exit $failed
> > --
> > 2.4.3
> >
>
>
>


More information about the samba-technical mailing list