53 done
54
55 echo $avail_disks
56 }
57
58 function find_rpool
59 {
60 typeset ds=$(mount | awk '/^\/ / {print $3}')
61 echo ${ds%%/*}
62 }
63
64 function find_runfile
65 {
66 typeset distro=
67 if [[ -d /opt/delphix && -h /etc/delphix/version ]]; then
68 distro=delphix
69 elif [[ 0 -ne $(grep -c OpenIndiana /etc/release 2>/dev/null) ]]; then
70 distro=openindiana
71 elif [[ 0 -ne $(grep -c OmniOS /etc/release 2>/dev/null) ]]; then
72 distro=omnios
73 fi
74
75 [[ -n $distro ]] && echo $STF_SUITE/runfiles/$distro.run
76 }
77
78 function verify_id
79 {
80 [[ $(id -u) = "0" ]] && fail "This script must not be run as root."
81
82 sudo -k -n id >/dev/null 2>&1
83 [[ $? -eq 0 ]] || fail "User must be able to sudo without a password."
84 }
85
86 function verify_disks
87 {
88 typeset disk
89 typeset path
90 for disk in $DISKS; do
91 case $disk in
92 /*) path=$disk;;
|
53 done
54
55 echo $avail_disks
56 }
57
58 function find_rpool
59 {
60 typeset ds=$(mount | awk '/^\/ / {print $3}')
61 echo ${ds%%/*}
62 }
63
64 function find_runfile
65 {
66 typeset distro=
67 if [[ -d /opt/delphix && -h /etc/delphix/version ]]; then
68 distro=delphix
69 elif [[ 0 -ne $(grep -c OpenIndiana /etc/release 2>/dev/null) ]]; then
70 distro=openindiana
71 elif [[ 0 -ne $(grep -c OmniOS /etc/release 2>/dev/null) ]]; then
72 distro=omnios
73 elif [[ 0 -ne $(grep -c Nexenta /etc/release 2>/dev/null) ]]; then
74 distro=nexenta
75 fi
76
77 [[ -n $distro ]] && echo $STF_SUITE/runfiles/$distro.run
78 }
79
80 function verify_id
81 {
82 [[ $(id -u) = "0" ]] && fail "This script must not be run as root."
83
84 sudo -k -n id >/dev/null 2>&1
85 [[ $? -eq 0 ]] || fail "User must be able to sudo without a password."
86 }
87
88 function verify_disks
89 {
90 typeset disk
91 typeset path
92 for disk in $DISKS; do
93 case $disk in
94 /*) path=$disk;;
|