This test code is not run (and has not been run for about a decade).
Let's remove it - it's there in the git history if we ever want to try
to repurpose it again.
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 12 02:56:05 UTC 2019 on sn-devel-144
'make wintest' in Samba 4 to perform smbtorture tests against a Windows host,
and perform tests from a Windows client to a Samba server.
-INTEGRATING WITH THE BUILD FARM
-
-Follow the standard steps to add a host to the build farm. The major
-difference is that we will need to run these tests as root. To run the
-Windows tests in the build farm, a .fns file will need to be created for
-your new host that exports a WINTESTCONF environment variable pointing to a
-config file used by 'make wintest'. An example of this config file can be
-found at source/selftest/win/test_win.conf in the Samba 4 source tree.
-
-I've also included the bnhtest.fns file that I'm using for my build farm host
-below, as an example. It was modified from generic.fns.
-
-action_test_windows() {
- do_make wintest
- w_status=$?
- echo "WINTEST STATUS: $w_status"
- return $w_status;
-}
-
-per_run_hook
-
-system=`uname`
-
-export WINTESTCONF="/home/build/win/test_win.conf"
-
-for compiler in gcc cc icc; do
-
- # arrgh, "which" gives no err code on solaris
- path=`which $compiler`
- if [ -x "$path" ]; then
-
- if $compiler -v 2>&1 | grep gcc.version > /dev/null; then
- isgcc=1
- CFLAGS="-Wall"
- export CFLAGS
- else
- CFLAGS=""
- export CFLAGS
- isgcc=0
- fi
- if [ $compiler = gcc -o $isgcc = 0 ]; then
-
- # only attempt samba4 if we have perl
- if which perl > /dev/null; then
- test_tree samba4 source $compiler configure build install test_windows test
- fi
- fi
- fi
-done
- nsswitch Tests for nsswitch extensions
- - build_farm Tests designed to run automatically on the build farm
-
-All the scripts except those in build_farm require an unreleased
+All the scripts require an unreleased
version of DejaGNU, and although they contain some useful tests they
are not so useful at the moment. All scripts are migrating to a
single test framework, Satyr. <cvs://cvs.samba.org/data/cvs/satyr>
+++ /dev/null
-#!/bin/sh
-# Modified version of tridge's backtrace script.
-# we want everything on stderr, so the program is not disturbed
-exec 1>&2
-
-PID=$1
-TMPFILE=$prefix/backtrace.$$
-cat << EOF > $TMPFILE
-set height 0
-up 8
-bt full
-quit
-EOF
-gdb -x $TMPFILE $prefix/sbin/smbd $PID
-/bin/rm -f $TMPFILE
+++ /dev/null
-. basicsmb.fns
-
-test_joindomain_nt4() {
-
- echo $prefix/bin/smbpasswd -L -a -m buildfarm$
- $prefix/bin/smbpasswd -L -a -m buildfarm$
-
- echo $prefix/bin/net rpc oldjoin -S localhost
- $prefix/bin/net rpc oldjoin -S localhost
- status=$?
- if [ $status = 0 ]; then
- echo "'net rpc oldjoin' correctly joined the domain"
- else
- echo "'net rpc oldjoin' failed to join the domain! (status $status)"
- return 1
- fi
- return 0
-}
-
-password=samba
-security=DOMAIN
-(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
-
-test_joindomain_nt4 $password || exit 1
-
-test_listfilesauth $security || exit 1
-test_listfilesnpw $security || exit 1
-
+++ /dev/null
-
-. basicsmb.fns
-
-test_joindomain() {
- test_join_domain_password="$1"
-
- echo "$prefix/bin/net rpc join -S localhost -U $whoami%$test_join_domain_password"
- $prefix/bin/net rpc join -S localhost -U $whoami%$test_join_domain_password
- status=$?
- if [ $status = 0 ]; then
- echo "'net rpc join' correctly joined the domain"
- else
- echo "'net rpc join' failed to join the domain! (status $status)"
- return 1
- fi
- return 0
-}
-
-password=samba
-(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
-
-test_joindomain $password || exit 1
-
-security=DOMAIN
-test_listfilesauth $security || exit 1
-test_listfilesnpw $security || exit 1
-
+++ /dev/null
-. basicsmb.fns
-
-password="samba"
-security="hostsdeny"
-(test_smb_conf_setup && test_smbpasswd $password) || exit 1
-
-(test_listfilesauth_should_deny $security) || exit 1
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-if [ $whoami = "root" ]; then
- exit 0;
-fi
-
-. basicsmb.fns
-
-test_listfilesrootnpw() {
- remote_name="$1"
- echo $prefix/bin/smbclient //$remote_name/samba -n buildclient -Uroot% -c 'ls'
- $prefix/bin/smbclient //$remote_name/samba -n buildclient -Uroot% -c 'ls'
- status=$?
- if [ $status = 0 ]; then
- echo "smbd listed files AS ROOT with NO PASSWORD (hosts equiv test)!"
- return 1
- else
- echo "listing files with smbd failed with status $status (correct)"
- fi
- return 0
-}
-
-password="not-a-valid-password"
-security="hostsequiv"
-(test_smb_conf_setup ) || exit 1
-
-(test_listfilesauth $security) || exit 1
-(test_listfilesrootnpw $security) || exit 1
+++ /dev/null
-. basicsmb.fns
-
-password="samba"
-security="invalidusers"
-(test_smb_conf_setup && test_smbpasswd $password) || exit 1
-
-(test_listfilesauth_should_deny $security) || exit 1
-
-security="validusers"
-(test_listfilesauth $security) || exit 1
+++ /dev/null
-. basicsmb.fns
-
-passwordold=samba
-password=samba2
-security=USER
-(test_smb_conf_setup && test_smbpasswd $passwordold && test_smbpasswd_local $passwordold $password) || exit 1
-
-test_listfilesauth $security || exit 1
-test_listfilesnpw $security || exit 1
-
+++ /dev/null
-. basicsmb.fns
-
-password=samba
-(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
-
-rm -f $prefix/testdir/preexec_touch
-
-mode=PREEXEC
-(test_listfilesauth $mode) || exit 1
-
-if [ -f $prefix/testdir/preexec_touch ]; then
- rm -f $prefix/testdir/preexec_touch
-else
- exit 1;
-fi
-
-mode=PREEXEC_close
-(test_listfilesauth $mode) || exit 1
-
-if [ -f $prefix/testdir/preexec_touch ]; then
- rm -f $prefix/testdir/preexec_touch
-else
- exit 1;
-fi
-
-mode=PREEXEC_cl_fl
-(test_listfilesauth_should_deny $mode) || exit 1
-
+++ /dev/null
-. basicsmb.fns
-
-passwordold=samba
-password=samba2
-security=USER
-(test_smb_conf_setup && test_smbpasswd $passwordold && test_smbpasswd_remote $passwordold $password) || exit 1
-
-test_listfilesauth $security || exit 1
-test_listfilesnpw $security || exit 1
-
+++ /dev/null
-. basicsmb.fns
-
-password=samba
-security=SERVER
-(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
-
-test_listfilesauth $security || exit 1
-test_listfilesnpw $security || exit 1
-
+++ /dev/null
-. basicsmb.fns
-
-test_listfilesguestshare() {
- remote_name=$1
- echo $prefix/bin/smbclient //$remote_name/guest_share -n buildclient -U$whoami% -c 'ls'
- $prefix/bin/smbclient //$remote_name/guest_share -n buildclient -U$whoami% -c 'ls'
- status=$?
- if [ $status = 0 ]; then
- echo "smbd listed files correctly (guest share)"
- else
- echo "listing files on a guest share failed with status $status"
- return 1
- fi
- return 0
-}
-
-security=SHARE
-( test_smb_conf_setup ) || exit 1
-
-( test_listfilesguestshare $security ) || exit 1
\ No newline at end of file
+++ /dev/null
-. basicsmb.fns
-test_sharelist() {
- echo $prefix/bin/smbclient -U$whoami% -L localhost
- $prefix/bin/smbclient -U$whoami% -L localhost
- status=$?
- if [ $status = 0 ]; then
- echo "smbd listed shares OK"
- else
- echo "listing shares with smbd failed with status $status"
- return 1
- fi
- return 0
-}
-
-# Need guest account
-password=samba
-security=USER
-(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
-
-test_sharelist || exit 1
-
-
+++ /dev/null
-. basicsmb.fns
-
-password="samba"
-security="SHARE"
-(test_smb_conf_setup && ( test_smbpasswd $password ) ) || exit 1
-
-(test_listfilesauth $security) || exit 1
-(test_listfilesnpw $security) || exit 1
-
+++ /dev/null
-. basicsmb.fns
-
-password=samba
-security=USER
-(test_smb_conf_setup && test_smbpasswd $password ) || exit 1
-
-test_listfilesauth $security || exit 1
-test_listfilesnpw $security || exit 1
-
+++ /dev/null
-#! /bin/sh
-
-# Common functions for Samba build scripts.
-
-# Copyright (C) 2001 by Martin Pool <mbp@samba.org> and others
-
-# The following variables are passed in by the calling script. They
-# originate in either the buildfarm scripts or the configured
-# Makefile.
-
-# PREFIX = Installed prefix of samba test installation. Used to
-# locate binaries, configuration files, etc.
-
-# XXX: It's pretty bad to clobber the installed configuration file and
-# other data in $prefix, because somebody might unwittingly run this
-# with prefix=/usr.
-
-# Really what we want is a consistent way to pass the location of the
-# configuration and all other files into *all* Samba programs
-# (smbclient, smd, ...) and be able to set them to a temporary
-# directory when testing. Some of them take a -c parameter, but tpot
-# says it's not done consistently.
-
-template_setup() {
- cat template/$1 | \
- sed "s|PREFIX|$prefix|g" | \
- sed "s|BUILD_FARM|$test_root|g" | \
- sed "s|WHOAMI|$whoami|g" | \
- sed "s|LOGLEVEL|$loglevel|g" \
- > $prefix/$2
- echo "template_setup: Created $prefix/$2"
-}
-
-template_smb_conf_setup() {
- template_setup "basicsmb.smb.conf$1" "lib/smb.conf$1"
-}
-
-test_smb_conf_setup() {
- echo "test_smb_conf_setup: Configuring: "
- echo " PREFIX=$prefix"
- echo " BUILD_FARM=$test_root"
- echo " WHOAMI=$whoami"
- echo " LOGLEVEL=$loglevel"
- echo " TREE=$tree"
-
- case "$prefix" in
- /usr*|/|//)
- echo "** I don't want to clobber your installation in "
- echo "** $prefix"
- echo "** by running tests there. Please reconfigure this source tree to"
- echo "** use a different prefix."
- exit 1
- esac
-
-# Please keep these names under 15 characters,
-# so that the final name is 31 characters or fewer.
-
- template_smb_conf_setup
- template_smb_conf_setup .hostsequiv
- template_smb_conf_setup .validusers
- template_smb_conf_setup .invalidusers
- template_smb_conf_setup .preexec
- template_smb_conf_setup .preexec_close
- template_smb_conf_setup .preexec_cl_fl
-
- template_smb_conf_setup .share
- template_smb_conf_setup .user
- template_smb_conf_setup .server
- template_smb_conf_setup .domain
-
- template_setup preexec lib/preexec
-
- touch $prefix/lib/smb.conf.
- touch $prefix/lib/smb.conf.localhost
-
- echo "127.0.0.1 localhost">$prefix/lib/lmhosts
- echo "127.0.0.2 BUILDFARM">>$prefix/lib/lmhosts
- echo "127.0.0.3 SHARE">>$prefix/lib/lmhosts
- echo "127.0.0.4 USER">>$prefix/lib/lmhosts
- echo "127.0.0.5 SERVER">>$prefix/lib/lmhosts
- echo "127.0.0.6 DOMAIN">>$prefix/lib/lmhosts
- echo "127.0.0.7 HOSTSEQUIV">>$prefix/lib/lmhosts
- echo "127.0.0.7 VALIDUSERS">>$prefix/lib/lmhosts
- echo "127.0.0.7 INVALIDUSERS">>$prefix/lib/lmhosts
- echo "127.0.0.7 PREEXEC">>$prefix/lib/lmhosts
- echo "127.0.0.7 PREEXEC_CLOSE">>$prefix/lib/lmhosts
- echo "127.0.0.7 PREEXEC_CL_FL">>$prefix/lib/lmhosts
-
-
- echo "127.0.0.1" > $prefix/lib/hosts.equiv
-
-}
-
-test_smbpasswd() {
- test_smbpasswd_password="$1"
- rm -f $prefix/private/smbpasswd
- echo "( echo $test_smbpasswd_password ; echo $test_smbpasswd_password; ) | $prefix/bin/smbpasswd -L -D $loglevel -s -a $whoami"
- ( echo $test_smbpasswd_password; echo $test_smbpasswd_password; ) | $prefix/bin/smbpasswd -L -D $loglevel -s -a $whoami
- status=$?
- if [ $status = 0 ]; then
- echo "smbpasswd correctly set initial password ($test_smbpasswd_password)"
- else
- echo "smbpasswd failed to set initial password ($test_smbpasswd_password)! (status $status)"
- return 1
- fi
- return 0
-}
-
-test_smbpasswd_remote() {
- test_smbpasswd_rem_password="$1"
- test_smbpasswd_rem_newpassword="$2"
- echo "( echo $test_smbpasswd_rem_password; echo $test_smbpasswd_rem_newpassword; echo $test_smbpasswd_rem_newpassword; ) | $prefix/bin/smbpasswd -r localhost -s -U $whoami"
- ( echo $test_smbpasswd_rem_password; echo $test_smbpasswd_rem_newpassword; echo $test_smbpasswd_rem_newpassword; ) | $prefix/bin/smbpasswd -r localhost -s -U $whoami
- status=$?
- if [ $status = 0 ]; then
- echo "smbpasswd correctly remotely changed password ($test_smbpasswd_rem_password -> $test_smbpasswd_rem_newpassword)"
- else
- echo "smbpasswd failed to remotely changed password ($test_smbpasswd_rem_password -> $test_smbpasswd_rem_newpassword)! (status $status)"
- return 1
- fi
- return 0
-}
-
-test_smbpasswd_local() {
- test_smbpasswd_newpassword="$2"
- echo "( echo $test_smbpasswd_newpassword ; echo $test_smbpasswd_newpassword; ) | $prefix/bin/smbpasswd -L -s $whoami"
- ( echo $test_smbpasswd_newpassword ; echo $test_smbpasswd_newpassword; ) | $prefix/bin/smbpasswd -L -s $whoami
- status=$?
- if [ $status = 0 ]; then
- echo "smbpasswd correctly locally changed password ($test_smbpasswd_password -> $test_smbpasswd_newpassword)"
- else
- echo "smbpasswd failed to locallly changed password ($test_smbpasswd_password -> $test_smbpasswd_newpassword)! (status $status)"
- return 1
- fi
- return 0
-}
-
-test_listfilesauth() {
- remote_name="$1"
- echo $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami%$password -c 'ls'
- $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami%$password -c 'ls'
- status=$?
- if [ $status = 0 ]; then
- echo "listed files OK"
- else
- echo "listing files with smbd failed with status $status"
- return 1
- fi
- return 0
-}
-
-test_listfilesnpw() {
- remote_name="$1"
- echo $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami% -c 'ls'
- $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami% -c 'ls'
- status=$?
- if [ $status = 0 ]; then
- echo "smbd listed files with NO PASSWORD on an authenticated share!"
- return 1
- else
- echo "listing files with smbd failed with status $status (correct)"
- fi
- return 0
-}
-
-test_listfilesauth_should_deny() {
- remote_name="$1"
- echo $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami%$password -c 'ls'
- $prefix/bin/smbclient //$remote_name/samba -n buildclient -U$whoami%$password -c 'ls'
- status=$?
- if [ $status = 0 ]; then
- echo "smbd LISTED FILES despite smb.conf entires to the contary!"
- return 1
- else
- echo "listing files with smbd failed with status $status (correct)"
- fi
- return 0
-}
-
-
-
-# Give sensible defaults to some variables.
-
-# "What's my age again?"
-
-if [ ! $USER = "" ]; then
- whoami=$USER
-else
- if [ ! $LOGNAME = "" ]; then
- whoami=$LOGNAME
- else
- whoami=build
- fi
-fi
-
-
-
-if test -z "$loglevel"
-then
- loglevel=1
-fi
-
+++ /dev/null
-TEST_ALL="basicsmb-sharelist basicsmb-local-pass-change \
-basicsmb-sharesec basicsmb-usersec \
-basicsmb-serversec \
-basicsmb-shareguest basicsmb-hostsequiv basicsmb-invalidusers \
-basicsmb-hostsdeny basicsmb-remote-pass-change \
-basicsmb-preexec \
-torture-FDPASS torture-LOCK1 torture-LOCK2 \
-torture-LOCK3 torture-LOCK4 torture-LOCK5 \
-torture-LOCK6 torture-LOCK7 \
-torture-UNLINK torture-BROWSE torture-ATTR \
-torture-TRANS2 torture-TORTURE torture-OPLOCK1 \
-torture-DIR torture-DIR1 torture-DENY1 \
-torture-DENY2 torture-TCON torture-TCON2 torture-TCONDEV \
-torture-RW1 torture-RW2 torture-OPEN torture-XCOPY \
-torture-RENAME torture-DELETE torture-PROPERTIES \
-torture-MANGLE torture-FDSESS"
-
-#basicsmb-domainsec basicsmb-domainsec-nt4
\ No newline at end of file
+++ /dev/null
-[global]
- netbios name = BUILDFARM
- workgroup = TESTWG
- log level = LOGLEVEL
- debug timestamp = no
- encrypt passwords = yes
- server string = Samba %v Build Farm Tests
- name resolve order = lmhosts
- guest account = WHOAMI
- domain logons = yes
-
- strict locking = yes
-
- include = PREFIX/lib/smb.conf.%L
-
- add machine script = useradd %u -d /dev/null -s /bin/false
-
- panic action = /bin/sh BUILD_FARM/samba/testsuite/build_farm/backtrace %d
-
- passdb backend = smbpasswd
-
- idmap uid = 10000-200000
- map hidden = yes
- create mask = 0777
-
-[test]
- path = PREFIX/testdir
- read only = no
-
-[samba]
- path = BUILD_FARM/samba_3_0
- read only = yes
- comment = Samba HEAD Sources
-
-[samba_2_2]
- path = BUILD_FARM/samba_2_2
- read only = yes
- comment = Samba 2.2. Sources
-
-[rsync]
- path = BUILD_FARM/rsync
- read only = yes
- comment = Rsync Sources
-
-[guest_share]
- path = PREFIX
- guest ok = yes
- read only = yes
- comment = Unauthenticated share for use in share level test
+++ /dev/null
-security=domain
-password server=user
+++ /dev/null
- hosts deny = 127.
\ No newline at end of file
+++ /dev/null
- hostname lookups = no
- hosts equiv=PREFIX/lib/hosts.equiv
- auth methods = hostsequiv
+++ /dev/null
- invalid users = WHOAMI
+++ /dev/null
-preexec = /bin/sh PREFIX/lib/preexec
+++ /dev/null
-preexec close = yes
-preexec = PREFIX/lib/preexec_does_not_exist
+++ /dev/null
-preexec close = yes
-preexec = /bin/sh PREFIX/lib/preexec
+++ /dev/null
-security=server
-password server=user
-smb passwd file=NON_EXISTANT_FILE
+++ /dev/null
- security = share
+++ /dev/null
- security = user
+++ /dev/null
- valid users = WHOAMI
+++ /dev/null
-#!/bin/sh
-
-echo "Test worked" > PREFIX/testdir/preexec_touch
+++ /dev/null
-. torture_setup.fns
-test_torture "ATTR"
+++ /dev/null
-. torture_setup.fns
-test_torture "BROWSE"
+++ /dev/null
-. torture_setup.fns
-test_torture "DELETE"
+++ /dev/null
-. torture_setup.fns
-test_torture "DENY1"
+++ /dev/null
-. torture_setup.fns
-test_torture "DENY2"
+++ /dev/null
-. torture_setup.fns
-test_torture "DIR"
+++ /dev/null
-. torture_setup.fns
-test_torture "DIR1"
+++ /dev/null
-. torture_setup.fns
-test_torture "FDSESS"
+++ /dev/null
-. torture_setup.fns
-test_torture "FDPASS"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK1"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK2"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK3"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK4"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK5"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK6"
+++ /dev/null
-. torture_setup.fns
-test_torture "LOCK7"
+++ /dev/null
-. torture_setup.fns
-test_torture "MANGLE"
+++ /dev/null
-. torture_setup.fns
-test_torture "OPEN"
+++ /dev/null
-. torture_setup.fns
-test_torture "OPLOCK1"
+++ /dev/null
-. torture_setup.fns
-test_torture "PROPERTIES"
+++ /dev/null
-. torture_setup.fns
-test_torture "RANDOMIPC"
+++ /dev/null
-. torture_setup.fns
-test_torture "RENAME"
+++ /dev/null
-. torture_setup.fns
-test_torture "RW1"
+++ /dev/null
-. torture_setup.fns
-test_torture "RW2"
+++ /dev/null
-. torture_setup.fns
-test_torture "TCON"
+++ /dev/null
-. torture_setup.fns
-test_torture "TCON1"
+++ /dev/null
-. torture_setup.fns
-test_torture "TCON2"
+++ /dev/null
-. torture_setup.fns
-test_torture "TCONDEV"
+++ /dev/null
-. torture_setup.fns
-test_torture "TORTURE"
+++ /dev/null
-. torture_setup.fns
-test_torture "TRANS2"
+++ /dev/null
-. torture_setup.fns
-test_torture "UNLINK"
+++ /dev/null
-. torture_setup.fns
-test_torture "XCOPY"
+++ /dev/null
-. basicsmb.fns
-
-test_torture() {
- torture_test=$1
- password=samba
- security=USER
- (test_smb_conf_setup && test_smbpasswd $password ) || return 1
-
- echo $srcdir/bin/smbtorture //localhost/test -U$whoami%$password $torture_test
- $srcdir/bin/smbtorture //localhost/test -U$whoami%$password $torture_test
- status=$?
- if [ $status = 0 ]; then
- echo "smbtorture test $torture_test worked"
- else
- echo "smbtorture test $torture_test FAILED (status $status)!"
- return 1
- fi
- return 0
-}