diff options
author | Brian Behlendorf <[email protected]> | 2017-08-15 17:26:38 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2017-08-15 17:26:38 -0700 |
commit | c8f9061fc714696a53cf4d14a4567f0a83dbf862 (patch) | |
tree | 42e8a39488899046384f9bb5e350032f438a3ae4 /scripts/smb.sh | |
parent | 70322be8dc160f003fa95e034462ad625b325568 (diff) |
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #6509
Diffstat (limited to 'scripts/smb.sh')
-rwxr-xr-x | scripts/smb.sh | 214 |
1 files changed, 0 insertions, 214 deletions
diff --git a/scripts/smb.sh b/scripts/smb.sh deleted file mode 100755 index 7cf6c4bc1..000000000 --- a/scripts/smb.sh +++ /dev/null @@ -1,214 +0,0 @@ -#!/bin/bash - -BASETANK="share" -DATE=`date "+%Y%m%d"` - -TEST_SMBFS=0 -TEST_DESTROY=0 - -if [ -z "$1" ]; then - echo "Usage: `basename $0` [unpack]<[smbfs][snapshot][all]>" - exit 1 -fi - -set_onoff() { - type="$1" - dataset="$2" - toggle="$3" - - current=`zfs get -H $type -o value $dataset` - if [ "$current" != "$toggle" ]; then - run "zfs set $type=$toggle $dataset" - fi -} - -check_exists() { - dataset="$1" - - extra="" - [ -n "$2" ] && extra="$2" - - zfs get all "$dataset" > /dev/null 2>&1 - if [ $? != 0 ]; then - run "zfs create $extra $dataset" - fi -} - -check_shares() { - if [ "$TEST_SMBFS" == "1" ]; then - echo "Shares:" - echo "=> usershare list:" - net usershare list - echo - echo "=> /etc/dfs/sharetab:" - cat /etc/dfs/sharetab - echo - fi - - sleep 2 -} - -test_header() { - echo "TEST: $*" - echo "======================================" -} - -run() { - cmd="$*" - - echo "CMD: $cmd" - $cmd -} - -# --------- -# Needs more work... -if echo "$*" | grep -qi "unpack"; then - zfs unmount -a - zfs unshare -a - run "zfs destroy -r $BASETANK/tests" - - sh /etc/init.d/zfs stop - -# for tid in `grep ^tid /proc/net/iet/volume | sed "s@.*:\([0-9].*\) name.*@\1@"` -# do -# ietadm --op delete --tid $tid -# done - - set -e - rmmod `lsmod | grep ^z | grep -v zlib_deflate | sed 's@ .*@@'` spl zlib_deflate - - pushd / > /dev/null - [ -f "tmp/zfs.tgz" ] && tar xzf tmp/zfs.tgz && rm tmp/zfs.tgz - [ -f "tmp/spl.tgz" ] && tar xzf tmp/spl.tgz && rm tmp/spl.tgz - popd > /dev/null - - depmod -a - - sh /etc/init.d/zfs start - set +e -fi - -# --------- -if echo "$*" | egrep -qi "smbfs|all"; then - check_exists $BASETANK/tests - - TEST_SMBFS=1 - - test_header "Exists || Create" - str= - for volnr in 1 2 3; do - check_exists $BASETANK/tests/smbfs$volnr - - str="$str $BASETANK/tests/smbfs$volnr" - done - run "zfs get sharesmb $str" - - # Set sharesmb=on - test_header "Enable SMB share" - for volnr in 1 2 3; do - set_onoff sharesmb "$BASETANK/tests/smbfs$volnr" on - check_shares - done - - # Share all - test_header "Share all (individually)" - for volnr in 1 2 3; do - run "zfs share $BASETANK/tests/smbfs$volnr" - check_shares - done - - # Unshare all - test_header "Unshare all (individually)" - for volnr in 1 2 3; do - run "zfs unshare $BASETANK/tests/smbfs$volnr" - check_shares - done - - # Change mountpoint - first unshare and then share individual - test_header "Change mount point (unshare ; share)" - mkdir -p /tests - set_onoff sharesmb "$str" off - for volnr in 3 1 2; do - run "zfs set mountpoint=/tests/smbfs$volnr $BASETANK/tests/smbfs$volnr" - echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr" - mount | grep ^$BASETANK/tests/smbfs$volnr - echo - - run "zfs mount $BASETANK/tests/smbfs$volnr" - echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr" - mount | grep ^$BASETANK/tests/smbfs$volnr - echo - - set_onoff sharesmb "$BASETANK/tests/smbfs$volnr" on - check_shares - - run "zfs share $BASETANK/tests/smbfs$volnr" - check_shares - - echo "-------------------" - done - - # Change mountpoint - remounting - test_header "Change mount point (remounting)" - for volnr in 3 1 2; do - run "zfs set mountpoint=/$BASETANK/tests/smbfs$volnr $BASETANK/tests/smbfs$volnr" - echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr" - mount | grep ^$BASETANK/tests/smbfs$volnr - echo - # => Doesn't seem to remount (!?) - - run "zfs mount $BASETANK/tests/smbfs$volnr" - echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr" - mount | grep ^$BASETANK/tests/smbfs$volnr - echo - # => Doesn't seem to reshare (!?) - - check_shares - - run "zfs share $BASETANK/tests/smbfs$volnr" - check_shares - - echo "-------------------" - done -fi - -# --------- -if echo "$*" | egrep -qi "smbfs|all"; then - test_header "Unshare + Share all" - - run "zfs share -a" ; check_shares - run "zfs unshare -a" ; check_shares -fi - -# --------- -if echo "$*" | grep -qi "snapshot|all"; then - test_header "Snapshots" - - echo ; echo "-------------------" - check_exists $BASETANK/tests/destroy - check_exists $BASETANK/tests/destroy/destroy1 - run "zfs destroy -r $BASETANK/tests/destroy" - - echo ; echo "-------------------" - check_exists $BASETANK/tests/destroy - run "zfs snapshot $BASETANK/tests/destroy@$DATE" - run "zfs destroy -r $BASETANK/tests/destroy" - - echo ; echo "-------------------" - check_exists $BASETANK/tests/destroy - run "zfs snapshot $BASETANK/tests/destroy@$DATE" - run "zfs destroy -r $BASETANK/tests/destroy@$DATE" - run "zfs destroy -r $BASETANK/tests/destroy" -fi - -if echo "$*" | egrep -qi "smbfs|snapshot|all"; then - test_header "Cleanup (Share all + Destroy all)" - - run "zfs share -a" - check_shares - - run "zfs destroy -r $BASETANK/tests" - check_shares - - run "zfs list" -fi |