diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-12-09 07:35:37 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-12-12 12:57:08 +0100 |
commit | 62a66b00b61cf4f85a81cca78e1432007b47ea11 (patch) | |
tree | eb7503ef4a5391732b92cdff412de1c35edc1d90 /testsuite | |
parent | c9d929af8ba018816df69734bed1c197d0c3b7f2 (diff) | |
download | samba-62a66b00b61cf4f85a81cca78e1432007b47ea11.tar.gz |
testsuite: Remove unused and unlikely to be revived DejaGNU tests
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/README | 4 | ||||
-rw-r--r-- | testsuite/config/unix.exp | 26 | ||||
-rw-r--r-- | testsuite/lib/compile.exp | 78 | ||||
-rw-r--r-- | testsuite/lib/default-nt-names.exp | 20 | ||||
-rw-r--r-- | testsuite/lib/env-single.exp | 36 | ||||
-rw-r--r-- | testsuite/lib/nsswitch-config.exp | 21 | ||||
-rw-r--r-- | testsuite/lib/smbclient.exp | 54 | ||||
-rw-r--r-- | testsuite/printing/Makefile.psec | 22 | ||||
-rw-r--r-- | testsuite/printing/psec.c | 438 | ||||
-rw-r--r-- | testsuite/server/ipc.exp | 44 | ||||
-rw-r--r-- | testsuite/server/masktest.exp | 57 | ||||
-rw-r--r-- | testsuite/server/rename.exp | 59 | ||||
-rw-r--r-- | testsuite/server/xfer.exp | 48 |
13 files changed, 0 insertions, 907 deletions
diff --git a/testsuite/README b/testsuite/README index 0d5157325a9..5ca207f62ae 100644 --- a/testsuite/README +++ b/testsuite/README @@ -3,13 +3,9 @@ README for testsuite directory The Samba testsuite is divided up into the following subdirectories. - - config Configuration for DejaGnu program - lib Various library files used by tool directories - nsswitch Tests for nsswitch extensions - - server Miscellaneous server tests - - rpc_client Tests for the RPC client library code - - rpcclient Tests for the rpcclient program - build_farm Tests designed to run automatically on the build farm diff --git a/testsuite/config/unix.exp b/testsuite/config/unix.exp deleted file mode 100644 index 892e94c67ad..00000000000 --- a/testsuite/config/unix.exp +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not see <http://www.gnu.org/licenses/>. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# This file was written by Rob Savoye. (rob@cygnus.com) - -# Set a default timeout to be used for the tests under UNIX, rather than -# accepting whatever default dejagnu gives us (apparently 10 seconds). -# When running the tests over NFS, under somewhat heavy load, 10 seconds -# does not seem to be enough. Try starting with 60. -set timeout 60 -verbose "Timeout is now $timeout seconds" 2 diff --git a/testsuite/lib/compile.exp b/testsuite/lib/compile.exp deleted file mode 100644 index 7dae87d213d..00000000000 --- a/testsuite/lib/compile.exp +++ /dev/null @@ -1,78 +0,0 @@ -# -# Compilation utility functions -# - -# -# Unix SMB/Netbios implementation. -# Copyright (C) Tim Potter 2000 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# - -# Compile a program consisting of one .c file. For example -# simple_compile "foo" will compile foo.c to the executable foo.exe -# Use a second argument to specify link libraries. - -proc simple_compile { args } { - global srcdir - global subdir - - # Compile up program - - set program [lindex $args 0] - set libs [lindex $args 1] - - if { $libs == "" } { - - set output [target_compile "$srcdir/$subdir/$program.c" \ - "$srcdir/$subdir/$program" executable \ - {additional_flags="-g"}] - } else { - - set output [target_compile "$srcdir/$subdir/$program.c" \ - "$srcdir/$subdir/$program" executable \ - [list libs=$libs additional_flags="-g"]] - } - - # Check for errors - - if {$output != ""} { - perror "compile $program" - puts $output - return -1 - } -} - -# Compile a program from a Makefile.suffix - -proc simple_make { args } { - global srcdir - global subdir - - # Compile up program with make - - set suffix [lindex $args 0] - set program [lindex $args 1] - - set output [util_start "make" \ - "-C $srcdir/$subdir -f Makefile.$suffix $program"] - - # Check for errors - - if { [regexp "Error" $output] } { - perror "make $program" - puts $output - return -1 - } -} diff --git a/testsuite/lib/default-nt-names.exp b/testsuite/lib/default-nt-names.exp deleted file mode 100644 index 5d01d2a5bb3..00000000000 --- a/testsuite/lib/default-nt-names.exp +++ /dev/null @@ -1,20 +0,0 @@ -# -# A list of default domain/local users/groups. Unfortunately this is tied -# to the English language version of Windows NT. -# - -global domain - -# Domain users and groups - -set domain_users [list "$domain/Administrator" "$domain/Guest"] - -set domain_groups [list "$domain/Domain Admins" "$domain/Domain Guests" \ - "$domain/Domain Users"] - -# Local groups - -set local_groups [list "BUILTIN/Replicator" "BUILTIN/Server Operators" \ - "BUILTIN/Account Operators" "BUILTIN/Backup Operators" \ - "BUILTIN/Print Operators" "BUILTIN/Guests" "BUILTIN/Users" \ - "BUILTIN/Administrators"] diff --git a/testsuite/lib/env-single.exp b/testsuite/lib/env-single.exp deleted file mode 100644 index 6cd7f94a869..00000000000 --- a/testsuite/lib/env-single.exp +++ /dev/null @@ -1,36 +0,0 @@ -# -# Environment variables for a single machine test. We look for the -# following environment variables: -# -# $TEST_SERVER The SMB server to contact for the test -# $TEST_SHARE Share name on $TEST_SERVER to contact -# $TEST_USER The username to connect to $TEST_SHARE as -# -# These are stored in the Tcl variables $server, $share and $user -# respectively. -# -# An error will be produced and the test will exit if any of these -# variables are not present. -# - -verbose "Loading single machine environment variables" - -catch {set server "$env(TEST_SERVER)"} tmp - -if {[regexp "^can't read" $tmp]} { - error "Environment variable TEST_SERVER not set" -} - -catch {set share "$env(TEST_SHARE)"} tmp - -if {[regexp "^can't read" $tmp]} { - error "Environment variable TEST_SHARE not set" -} - -catch {set user "$env(TEST_USER)"} tmp - -if {[regexp "^can't read" $tmp]} { - error "Environment variable TEST_USER not set" -} - -verbose "Single machine is //$server/$share -U $user" diff --git a/testsuite/lib/nsswitch-config.exp b/testsuite/lib/nsswitch-config.exp deleted file mode 100644 index 38342685dfa..00000000000 --- a/testsuite/lib/nsswitch-config.exp +++ /dev/null @@ -1,21 +0,0 @@ -# -# Load environment variables -# - -global tool - -if { [file exists "deja-$tool.tcl"] } { - source "deja-$tool.tcl" -} - -# Required options - -if { ![info exists WORKGROUP] } { - error "\$WORKGROUP not set in config file" -} - -if { ![info exists PDC] } { - error "\$PDC not set in config file" -} - -set domain $WORKGROUP diff --git a/testsuite/lib/smbclient.exp b/testsuite/lib/smbclient.exp deleted file mode 100644 index dc55d72139c..00000000000 --- a/testsuite/lib/smbclient.exp +++ /dev/null @@ -1,54 +0,0 @@ -# -# Utilities for driving smbclient -# - -# Variables - -set smb_prompt "smb: \\\\>" - -# Spawn smbclient and wait for a prompt - -proc spawn_smbclient { args } { - set result 0 - global smb_prompt - global spawn_id - - # Spawn smbclient - - spawn smbclient [lindex $args 0] [lindex $args 1] [lindex $args 2] \ - [lindex $args 3] [lindex $args 4] [lindex $args 5] \ - [lindex $args 6] - - # Wait for prompt - - expect { - $smb_prompt { set result 1 } - timeout { perror "timed out spawning smbclient" } - eof { perror "end of file spawning smbclient" } - } - - return $result -} - -# Run a command and wait for a prompt - -proc do_smbclient { args } { - set action [lindex $args 0] - set description [lindex $args 1] - global smb_prompt - - # Send command - - verbose $action - - send $action - - expect { - $smb_prompt {} - timeout { perror "timed out $description"; return -1} - eof { perror "end of file $description"; return -1 } - } - - verbose $expect_out(buffer) - return $expect_out(buffer) -} diff --git a/testsuite/printing/Makefile.psec b/testsuite/printing/Makefile.psec deleted file mode 100644 index 1410c9e0099..00000000000 --- a/testsuite/printing/Makefile.psec +++ /dev/null @@ -1,22 +0,0 @@ -# -# Makefile for psec utility -# - -# -# NOTE: Samba must be configured with the --srcdir option before this Makefile -# will work: ./configure --srcdir=`pwd` -# -# Compile with: make -f Makefile.psec psec -# - -psec_default: psec - -include ../../source/Makefile - -PSEC_OBJ1 = $(LIB_OBJ) $(PARAM_OBJ) $(UBIQX_OBJ) $(RPC_PARSE_OBJ) \ - $(LIBSMB_OBJ) $(PASSDB_OBJ) $(RPC_CLIENT_OBJ) - -PSEC_OBJS = $(PSEC_OBJ1:%=$(srcdir)/%) - -psec: $(PSEC_OBJS) psec.o - $(CC) -o $@ psec.o $(PSEC_OBJS) $(LIBS) diff --git a/testsuite/printing/psec.c b/testsuite/printing/psec.c deleted file mode 100644 index 59205446d05..00000000000 --- a/testsuite/printing/psec.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - Unix SMB/Netbios implementation. - Version 2.0 - - Printer security permission manipulation. - - Copyright (C) Tim Potter 2000 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -/* This program can get or set NT printer security permissions from the - command line. Usage: psec getsec|setsec printername. You must have - write access to the ntdrivers.tdb file to set permissions and read - access to get permissions. - - For this program to compile using the supplied Makefile.psec, Samba - must be configured with the --srcdir option - - For getsec, output like the following is sent to standard output: - - S-1-5-21-1067277791-1719175008-3000797951-500 - - 1 9 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-501 - 1 2 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-501 - 0 9 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-500 - 0 2 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-500 - 0 9 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-513 - 0 2 0x00020000 S-1-5-21-1067277791-1719175008-3000797951-513 - 0 2 0xe0000000 S-1-1-0 - - The first two lines describe the owner user and owner group of the printer. - If either of these lines are blank then the respective owner property is - not set. The remaining lines list the printer permissions or ACE entries, - one per line. Each column describes a different property of the ACE: - - Column Description - ------------------------------------------------------------------- - 1 ACE type (allow/deny etc) defined in rpc_secdes.h - 2 ACE flags defined in rpc_secdes.h - 3 ACE mask - printer ACE masks are defined in rpc_spoolss.h - 4 SID the ACE applies to - - The above example describes the following permissions in order: - - - The guest user has No Access to the printer - - The domain administrator has Full Access - - Domain Users can Manage Documents - - Everyone has Print access - - The setsec command takes the output format but sets the security descriptor - appropriately. */ - -#include "includes.h" - -TDB_CONTEXT *tdb; - -/* ACE type conversions */ - -char *ace_type_to_str(uint ace_type) -{ - static fstring temp; - - switch(ace_type) { - case SEC_ACE_TYPE_ACCESS_DENIED: - return "DENY"; - case SEC_ACE_TYPE_ACCESS_ALLOWED: - return "ALLOW"; - } - - slprintf(temp, sizeof(temp) - 1, "0x%02x", ace_type); - return temp; -} - -uint str_to_ace_type(char *ace_type) -{ - if (strcmp(ace_type, "ALLOWED") == 0) - return SEC_ACE_TYPE_ACCESS_ALLOWED; - - if (strcmp(ace_type, "DENIED") == 0) - return SEC_ACE_TYPE_ACCESS_DENIED; - - return -1; -} - -/* ACE mask (permission) conversions */ - -char *ace_mask_to_str(uint32 ace_mask) -{ - static fstring temp; - - switch (ace_mask) { - case PRINTER_ACE_FULL_CONTROL: - return "Full Control"; - case PRINTER_ACE_MANAGE_DOCUMENTS: - return "Manage Documents"; - case PRINTER_ACE_PRINT: - return "Print"; - } - - slprintf(temp, sizeof(temp) - 1, "0x%08x", ace_mask); - return temp; -} - -uint32 str_to_ace_mask(char *ace_mask) -{ - if (strcmp(ace_mask, "Full Control") == 0) - return PRINTER_ACE_FULL_CONTROL; - - if (strcmp(ace_mask, "Manage Documents") == 0) - return PRINTER_ACE_MANAGE_DOCUMENTS; - - if (strcmp(ace_mask, "Print") == 0) - return PRINTER_ACE_PRINT; - - return -1; -} - -/* ACE conversions */ - -char *ace_to_str(SEC_ACE *ace) -{ - static pstring temp; - fstring sidstr; - - sid_to_string(sidstr, &ace->sid); - - slprintf(temp, sizeof(temp) - 1, "%s %d %s %s", - ace_type_to_str(ace->type), ace->flags, - ace_mask_to_str(ace->info.mask), sidstr); - - return temp; -} - -void str_to_ace(SEC_ACE *ace, char *ace_str) -{ - SEC_ACCESS sa; - struct dom_sid sid; - uint32 mask; - uint8 type, flags; - - init_sec_access(&sa, mask); - init_sec_ace(ace, &sid, type, sa, flags); -} - -/* Get a printer security descriptor */ - -int psec_getsec(char *printer) -{ - SEC_DESC_BUF *secdesc_ctr = NULL; - TALLOC_CTX *mem_ctx = NULL; - fstring keystr, sidstr, tdb_path; - prs_struct ps; - int result = 0, i; - - ZERO_STRUCT(ps); - - /* Open tdb for reading */ - - slprintf(tdb_path, sizeof(tdb_path) - 1, "%s/ntdrivers.tdb", - lp_lockdir()); - - tdb = tdb_open_compat(tdb_path, 0, 0, O_RDONLY, 0600, NULL, NULL); - - if (!tdb) { - printf("psec: failed to open nt drivers database: %s\n", - sys_errlist[errno]); - return 1; - } - - /* Get security blob from tdb */ - - slprintf(keystr, sizeof(keystr) - 1, "SECDESC/%s", printer); - - mem_ctx = talloc_init(); - - if (!mem_ctx) { - printf("memory allocation error\n"); - result = 1; - goto done; - } - - if (tdb_prs_fetch(tdb, keystr, &ps, mem_ctx) != 0) { - printf("error fetching descriptor for printer %s\n", - printer); - /* cannot do a prs_mem_free() when tdb_prs_fetch fails */ - /* as the prs structure has not been initialized */ - tdb_close(tdb); - talloc_destroy(mem_ctx); - return 1; - } - - /* Unpack into security descriptor buffer */ - - if (!sec_io_desc_buf("nt_printing_getsec", &secdesc_ctr, &ps, 1)) { - printf("error unpacking sec_desc_buf\n"); - result = 1; - goto done; - } - - /* Print owner and group sid */ - - if (secdesc_ctr->sec->owner_sid) { - sid_to_string(sidstr, secdesc_ctr->sec->owner_sid); - } else { - fstrcpy(sidstr, ""); - } - - printf("%s\n", sidstr); - - if (secdesc_ctr->sec->grp_sid) { - sid_to_string(sidstr, secdesc_ctr->sec->grp_sid); - } else { - fstrcpy(sidstr, ""); - } - - printf("%s\n", sidstr); - - /* Print aces */ - - if (!secdesc_ctr->sec->dacl) { - result = 0; - goto done; - } - - for (i = 0; i < secdesc_ctr->sec->dacl->num_aces; i++) { - SEC_ACE *ace = &secdesc_ctr->sec->dacl->ace[i]; - - sid_to_string(sidstr, &ace->sid); - - printf("%d %d 0x%08x %s\n", ace->type, ace->flags, - ace->info.mask, sidstr); - } - - done: - if (tdb) tdb_close(tdb); - if (mem_ctx) talloc_destroy(mem_ctx); - if (secdesc_ctr) free_sec_desc_buf(&secdesc_ctr); - prs_mem_free(&ps); - - return result; -} - -/* Set a printer security descriptor */ - -int psec_setsec(char *printer) -{ - struct dom_sid user_sid, group_sid; - SEC_ACE *ace_list = NULL; - SEC_ACL *dacl = NULL; - SEC_DESC *sd; - SEC_DESC_BUF *sdb = NULL; - int result = 0, num_aces = 0; - fstring line, keystr, tdb_path; - size_t size; - prs_struct ps; - TALLOC_CTX *mem_ctx = NULL; - BOOL has_user_sid = False, has_group_sid = False; - - ZERO_STRUCT(ps); - - /* Open tdb for reading */ - - slprintf(tdb_path, sizeof(tdb_path) - 1, "%s/ntdrivers.tdb", - lp_lockdir()); - - tdb = tdb_open_compat(tdb_path, 0, 0, O_RDWR, 0600, NULL, NULL); - - if (!tdb) { - printf("psec: failed to open nt drivers database: %s\n", - sys_errlist[errno]); - result = 1; - goto done; - } - - /* Read owner and group sid */ - - fgets(line, sizeof(fstring), stdin); - if (line[0] != '\n') { - string_to_sid(&user_sid, line); - has_user_sid = True; - } - - fgets(line, sizeof(fstring), stdin); - if (line[0] != '\n') { - string_to_sid(&group_sid, line); - has_group_sid = True; - } - - /* Read ACEs from standard input for discretionary ACL */ - - while(fgets(line, sizeof(fstring), stdin)) { - int ace_type, ace_flags; - uint32 ace_mask; - fstring sidstr; - struct dom_sid sid; - SEC_ACCESS sa; - - if (sscanf(line, "%d %d 0x%x %s", &ace_type, &ace_flags, - &ace_mask, sidstr) != 4) { - continue; - } - - string_to_sid(&sid, sidstr); - - ace_list = Realloc(ace_list, sizeof(SEC_ACE) * - (num_aces + 1)); - - init_sec_access(&sa, ace_mask); - init_sec_ace(&ace_list[num_aces], &sid, ace_type, sa, - ace_flags); - - num_aces++; - } - - dacl = make_sec_acl(ACL_REVISION, num_aces, ace_list); - free(ace_list); - - /* Create security descriptor */ - - sd = make_sec_desc(SEC_DESC_REVISION, - has_user_sid ? &user_sid : NULL, - has_group_sid ? &group_sid : NULL, - NULL, /* System ACL */ - dacl, /* Discretionary ACL */ - &size); - - free_sec_acl(&dacl); - - sdb = make_sec_desc_buf(size, sd); - - free_sec_desc(&sd); - - /* Write security descriptor to tdb */ - - mem_ctx = talloc_init(); - - if (!mem_ctx) { - printf("memory allocation error\n"); - result = 1; - goto done; - } - - if (!prs_init(&ps, (uint32)sec_desc_size(sdb->sec) + - sizeof(SEC_DESC_BUF), 4, mem_ctx, MARSHALL)) { - printf("prs_init() failed\n"); - goto done; - } - - if (!sec_io_desc_buf("nt_printing_setsec", &sdb, &ps, 1)) { - printf("sec_io_desc_buf failed\n"); - goto done; - } - - slprintf(keystr, sizeof(keystr) - 1, "SECDESC/%s", printer); - - if (!tdb_prs_store(tdb, keystr, &ps)==0) { - printf("Failed to store secdesc for %s\n", printer); - goto done; - } - - done: - if (tdb) tdb_close(tdb); - if (sdb) free_sec_desc_buf(&sdb); - if (mem_ctx) talloc_destroy(mem_ctx); - prs_mem_free(&ps); - - return result; -} - -/* Help */ - -void usage(void) -{ - printf("Usage: psec getsec|setsec printername\n"); -} - -/* Main function */ - -int main(int argc, char **argv) -{ - pstring servicesf = CONFIGFILE; - - /* Argument check */ - - if (argc == 1) { - usage(); - return 1; - } - - /* Load smb.conf file */ - - charset_initialise(); - - if (!lp_load(servicesf,False,False,True)) { - fprintf(stderr, "Couldn't load confiuration file %s\n", - servicesf); - return 1; - } - - /* Do commands */ - - if (strcmp(argv[1], "setsec") == 0) { - - if (argc != 3) { - usage(); - return 1; - } - - return psec_setsec(argv[2]); - } - - if (strcmp(argv[1], "getsec") == 0) { - - if (argc != 3) { - usage(); - return 1; - } - - return psec_getsec(argv[2]); - } - - /* An unknown command */ - - printf("psec: unknown command %s\n", argv[1]); - return 1; -} diff --git a/testsuite/server/ipc.exp b/testsuite/server/ipc.exp deleted file mode 100644 index ae0688872a8..00000000000 --- a/testsuite/server/ipc.exp +++ /dev/null @@ -1,44 +0,0 @@ -# -# Test operations on IPC$ share -# - -# Initialisation - -load_lib env-single.exp -load_lib smbclient.exp - -set timeout 10 - -# Spawn a smbclient - -if {![spawn_smbclient //$server/ipc\$ -U $user]} { - perror "error spawning smbclient" - return -1 -} - -# -# Start performing tests -# - -global smb_prompt - -do_smbclient "lcd /tmp\r" "lcd /tmp" -do_smbclient "!touch test.out\r" "touch test.out" - -foreach { op } { "dir\r" "put test.out\r" "get test.out\r" \ - "get /etc/passwd\r" "mkdir foo\r" "print test.out\r" } { - - set action "doing $op" - set output [do_smbclient $op $action] - - if {![regexp "ERR" $output]} { - fail $action - puts $output - } else { - pass $action - } -} - -# Clean up - -file delete test.out diff --git a/testsuite/server/masktest.exp b/testsuite/server/masktest.exp deleted file mode 100644 index 532291bffb8..00000000000 --- a/testsuite/server/masktest.exp +++ /dev/null @@ -1,57 +0,0 @@ -# -# Test various things using the masktest program -# - -# Initialisation - -load_lib env-single.exp - -set timeout 10 - -# Test each wildcard individually, then all together at once - -set testlist {{"abc" "<"} {"abc" ">"} {"abc" "\""} {"abc" "?"} {"abc" "*"} \ - {"abc" "."} {"abc" "<>\"?*."}} - -foreach { test } $testlist { - - set got_output 0 - set fail 0 - - # Spawn masktest - - spawn bin/masktest //$server/$share -U $user -n 1000 -a \ - -f [lindex $test 0] -m [concat [lindex $test 0] [lindex $test 1]] - - # Check output - - while 1 { - expect { - -re "(...) (...) \[0-9\]+ mask=" { - if { $expect_out(1,string) != $expect_out(2,string) } { - fail "masktest [lindex $test 1]" - puts $expect_out(0,string); - set fail 1 - break; - } else { - set got_output 1 - } - } - eof { break } - } - } - - # Produce result - - set testname "[lindex $test 0] [lindex $test 1]" - - if {$got_output} { - if {$fail} { - fail "masktest $testname" - } else { - pass "masktest $testname" - } - } else { - perror "no output seen for test $testname" - } -} diff --git a/testsuite/server/rename.exp b/testsuite/server/rename.exp deleted file mode 100644 index 77e7297776b..00000000000 --- a/testsuite/server/rename.exp +++ /dev/null @@ -1,59 +0,0 @@ -# -# Test misc file operations -# - -# Initialisation - -load_lib env-single.exp -load_lib smbclient.exp - -set timeout 10 - -# Spawn a connection - -if {![spawn_smbclient //$server/$share -U $user]} { - perror "error spawning smbclient" - return -1 -} - -# Do wildcard rename test - -foreach { op } {"!touch /tmp/test.out\r" "lcd /tmp\r" "rm test.out\r" \ - "put test.out\r"} { - - set action "doing $op" - set output [do_smbclient $op $action] - - if {[regexp "ERR" $output]} { - perror $action - puts $output - return -1; - } -} - -file delete "/tmp/test.out" - -# Perform rename - -set output [do_smbclient "rename *.out *.dat\r" "wildcard rename"] - -if {[regexp "ERR" $output]} { - perror "wildcard rename didn't work" - return -1 -} - -# Check it worked - -set testname "wildcard match" -set output [do_smbclient "dir\r" "wildcard rename check"] - -if {[regexp "test.dat" $output]} { - pass $testname -} else { - fail $testname -} - -# Clean up - -set op "rm test.dat\r" -do_smbclient $op "doing $op" diff --git a/testsuite/server/xfer.exp b/testsuite/server/xfer.exp deleted file mode 100644 index 6d00b29885c..00000000000 --- a/testsuite/server/xfer.exp +++ /dev/null @@ -1,48 +0,0 @@ -# -# Test file transfer -# - -# Initialisation - -load_lib util-defs.exp -load_lib smbclient.exp -load_lib env-single.exp - -set timeout 60 - -# Spawn a connection - -if {![spawn_smbclient //$server/$share -U $user]} { - perror "error spawning smbclient" - return -1 -} - -# Create a big file, store it and fetch it again - -foreach { op } { "!dd if=/dev/urandom of=/tmp/file bs=1048576 count=1\r" \ - "lcd /tmp\r" "put file\r" "get file /tmp/file2\r" } { - - set action "doing $op" - set output [do_smbclient $op $action] - - if {[regexp "ERR" $output]} { - error $action - puts $output - return -1 - } -} - -# Compare the two files - -set output [util_start "diff" "/tmp/file /tmp/file2" ""] - -if {[regexp "differ" $output]} { - fail "xfertest" - puts $output -} else { - pass "xfertest" -} - -# Clean up temporary files - -file delete /tmp/file /tmp/file2 |