Author: brad Date: 2007-02-20 22:28:43 +0000 (Tue, 20 Feb 2007) New Revision: 21475
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21475 Log: Updated vm_get_ip.pl to read the name of the environment variable containing the VM path from the command line. wintest_2k3_dc.sh is a new script which will run a group of tests against a Windows 2003 DC. The group of tests to run should be passed in on the command line. These tests were taken from the source/script/tests/test_win2k3.sh script. tests_win2k3_dc.sh is a new script intended to be called by 'make wintest_dc' (patch to source/main.mk forthcoming). This is intended to provide the basis for Windows 2003 DC testing in the build farm. In order to use these tests, you should have a DC setup as a VM in VMware server. This process is not automated yet, but can be done by following a few steps: 1. Prepare a Windows 2003 VM in VMware Server by downloading and extracting: svn://svn.samba.org/home/svn/samba/branches/SOC/bnh/vm_setup.tar.gz and following the instructions in the README file. 2. Copying the following file onto the filesystem of the VM configured in step 1: svn://svn.samba.org/home/svn/samba/branches/SOC/bnh/dcpromo_2k3dc_newdomain.answerfile.txt and use it to promote the VM. For example: "dcpromo /answer:<path to answerfile>" 3. On the system you are testing from, set the environment variable WINTESTCONF, and SRCDIR. WINTESTCONF should point to the path of a test_win.conf file modified for your environment. There's a default copy in source/script/tests/win/test_win.conf. SRCDIR should point to the base of your Samba 4 source tree. At that point, you should be able to run wintest_2k3_dc.sh by passing a group of tests at the command line. For example: source/script/tests/win/wintest_2k3_dc.sh RPC-DRSUAPI Sorry for the long-winded commit message! Added: branches/SAMBA_4_0/source/script/tests/tests_win2k3_dc.sh branches/SAMBA_4_0/source/script/tests/win/wintest_2k3_dc.sh Modified: branches/SAMBA_4_0/source/script/tests/win/vm_get_ip.pl Changeset: Added: branches/SAMBA_4_0/source/script/tests/tests_win2k3_dc.sh =================================================================== --- branches/SAMBA_4_0/source/script/tests/tests_win2k3_dc.sh 2007-02-20 19:57:14 UTC (rev 21474) +++ branches/SAMBA_4_0/source/script/tests/tests_win2k3_dc.sh 2007-02-20 22:28:43 UTC (rev 21475) @@ -0,0 +1,22 @@ +#!/bin/sh + +if [ ! $WINTESTCONF ]; then + echo "Environment variable WINTESTCONF has not been defined." + echo "Windows tests will not run unconfigured." + exit 1 +fi + +if [ ! -r $WINTESTCONF ]; then + echo "$WINTESTCONF could not be read." + exit 1 +fi + +. script/tests/test_functions.sh + +export SRCDIR=$SRCDIR + +tests="RPC-DRSUAPI RPC-SPOOLSS ncacn_np ncacn_ip_tcp" + +for name in $tests; do + testit $name $SRCDIR/script/tests/win/wintest_2k3_dc.sh $name +done Property changes on: branches/SAMBA_4_0/source/script/tests/tests_win2k3_dc.sh ___________________________________________________________________ Name: svn:executable + * Modified: branches/SAMBA_4_0/source/script/tests/win/vm_get_ip.pl =================================================================== --- branches/SAMBA_4_0/source/script/tests/win/vm_get_ip.pl 2007-02-20 19:57:14 UTC (rev 21474) +++ branches/SAMBA_4_0/source/script/tests/win/vm_get_ip.pl 2007-02-20 22:28:43 UTC (rev 21475) @@ -19,7 +19,7 @@ } # Read in parameters from environment. -my $vm_cfg_path = $ENV{'VM_CFG_PATH'}; +my $vm_cfg_path = $ENV{"$ARGV[0]"}; my $host_server_name = $ENV{'HOST_SERVER_NAME'}; my $host_server_port = $ENV{'HOST_SERVER_PORT'}; if (!defined($host_server_port)) { Added: branches/SAMBA_4_0/source/script/tests/win/wintest_2k3_dc.sh =================================================================== --- branches/SAMBA_4_0/source/script/tests/win/wintest_2k3_dc.sh 2007-02-20 19:57:14 UTC (rev 21474) +++ branches/SAMBA_4_0/source/script/tests/win/wintest_2k3_dc.sh 2007-02-20 22:28:43 UTC (rev 21475) @@ -0,0 +1,116 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then +cat <<EOF +Usage: wintest_2k3_dc.sh TESTGROUP +EOF +exit 1; +fi + +TESTGROUP=$1 + +if [ -z $SRCDIR ]; then + echo "Please point environment variable SRCDIR to the Samba 4 source tree." + exit 1; +fi + +WINTEST_DIR=$SRCDIR/script/tests/win + +# This variable is defined in the per-hosts .fns file for build-farm hosts that run windows tests. +if [ -z $WINTESTCONF ]; then + echo "Please point environment variable WINTESTCONF to your test_win.conf file." + exit 1; +fi + +. $WINTESTCONF +. $WINTEST_DIR/wintest_functions.sh + +WIN2K3_DC_REMOTE_HOST=`perl -I$WINTEST_DIR $WINTEST_DIR/vm_get_ip.pl WIN2K3_DC_VM_CFG_PATH` + +if [ -z $WIN2K3_DC_REMOTE_HOST ]; then + # Restore snapshot to ensure VM is in a known state, then exit. + restore_snapshot "Test failed to get the IP address of the windows 2003 DC." "$WIN2K3_DC_VM_CFG_PATH" + exit 1; +fi + +server=$WIN2K3_DC_REMOTE_HOST +username=$WIN2K3_DC_USERNAME +password=$WIN2K3_DC_PASSWORD +domain=$WIN2K3_DC_DOMAIN +realm=$WIN2K3_DC_REALM + +OPTIONS="-U$username%$password -W $domain --option realm=$realm" + +all_errs=0 + +on_error() { + name=$1 + + all_errs=`expr $all_errs + 1` + restore_snapshot "$name test failed." "$WIN2K3_DC_VM_CFG_PATH" +} + +drsuapi_tests() { + + name="RPC-DRSUAPI on ncacn_ip_tcp with seal" + bin/smbtorture \ + ncacn_ip_tcp:$server[seal] $OPTIONS \ + RPC-DRSUAPI || on_error $name + + name="RPC-DRSUAPI on ncacn_ip_tcp with seal,bigendian" + bin/smbtorture \ + ncacn_ip_tcp:$server[seal,bigendian] $OPTIONS \ + RPC-DRSUAPI || on_error $name +} + +spoolss_tests() { + + name="RPC-SPOOLSS on ncacn_np" + bin/smbtorture \ + ncacn_np:$server $OPTIONS \ + RPC-SPOOLSS || on_error $name +} + +ncacn_ip_tcp_tests() { + bindopt=$1 + transport="ncacn_ip_tcp" + tests="RPC-SCHANNEL RPC-EPMAPPER RPC-SAMR RPC-NETLOGON RPC-LSA RPC-SAMLOGON RPC-SAMSYNC RPC-MULTIBIND" + + for bindoptions in $bindopt; do + for t in $tests; do + name="$t on $transport with $bindoptions" + bin/smbtorture $TORTURE_OPTIONS \ + $transport:$server[$bindoptions] \ + $OPTIONS $t || on_error $name + done + done +} + +ncacn_np_tests() { + bindopt=$1 + transport="ncacn_np" + tests="RPC-SCHANNEL RPC-DSSETUP RPC-EPMAPPER RPC-SAMR RPC-WKSSVC RPC-SRVSVC RPC-EVENTLOG RPC-NETLOGON RPC-LSA RPC-SAMLOGON RPC-SAMSYNC RPC-MULTIBIND RPC-WINREG" + + for bindoptions in $bindopt; do + for t in $tests; do + name="$t on $transport with $bindoptions" + bin/smbtorture $TORTURE_OPTIONS \ + $transport:$server[$bindoptions] \ + $OPTIONS $t || on_error $name + done + done +} + +bindoptions="padcheck connect sign seal ntlm,sign ntml,seal $VALIDATE bigendian" + +case $TESTGROUP in + RPC-DRSUAPI) drsuapi_tests ;; + RPC-SPOOLSS) spoolss_tests ;; + ncacn_ip_tcp) ncacn_ip_tcp_tests $bindoptions ;; + ncacn_np) ncacn_np_tests $bindoptions ;; + *) echo "$TESTGROUP is not a known set of tests." + exit 1; + ;; +esac + +exit $all_errs Property changes on: branches/SAMBA_4_0/source/script/tests/win/wintest_2k3_dc.sh ___________________________________________________________________ Name: svn:executable + *