3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
24 # generic initialization
28 trap "rm -f /tmp/$$.; exit" 0 1 2 3 15
38 NSLOOKUP_PROG="`set_prog_path nslookup`"
39 if [ "$NSLOOKUP_PROG" = "" ]; then
40 getent hosts `uname -n` | awk '{print $2}'
42 $NSLOOKUP_PROG `hostname` | $AWK_PROG '{ if ($1 == "Name:") print $2 }'
48 echo "Creating the group index ..."
49 cat <<'End-of-File' >group
52 # define groups and default group owners
53 # do not start group name with a digit
60 # test-group association ... one line per test
68 echo "Warning: making the index file \"group\" writeable"
75 echo "Warning: make failed -- some tests may be missing"
78 last=`grep '^[0-9][0-9]* ' group | sort | tail -1 | sed -e 's/[ ].*//'`
79 # get rid of leading 0s as can be interpreted as octal
80 last=`echo $last | sed 's/^0*//'`
81 id=`$AWK_PROG </dev/null 'BEGIN{printf "%03d\n",'$last'+1}'`
82 echo "Next test is $id"
86 echo "Error: test $id already exists!"
91 echo -n "Creating skeletal script for you to edit ..."
95 cat <<End-of-File >$id
101 #-----------------------------------------------------------------------
102 # Copyright (c) $year YOUR NAME HERE. All Rights Reserved.
104 # This program is free software; you can redistribute it and/or
105 # modify it under the terms of the GNU General Public License as
106 # published by the Free Software Foundation.
108 # This program is distributed in the hope that it would be useful,
109 # but WITHOUT ANY WARRANTY; without even the implied warranty of
110 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
111 # GNU General Public License for more details.
113 # You should have received a copy of the GNU General Public License
114 # along with this program; if not, write the Free Software Foundation,
115 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
116 #-----------------------------------------------------------------------
119 owner=$USER@`_get_fqdn`
122 echo "QA output created by \$seq"
126 status=1 # failure is the default!
127 trap "_cleanup; exit \\\$status" 0 1 2 3 15
135 # get standard environment, filters and checks
139 # real QA test starts here
141 # Modify as appropriate.
142 _supported_fs generic
143 _supported_os IRIX Linux
148 # optional stuff if your test has verbose output to help resolve problems
150 #echo "If failure, check \$seq.full (this) and \$seq.full.ok (reference)"
157 sleep 2 # latency to read messages to this point
167 echo -n "Add to group(s) [other] (? for list): "
169 [ -z "$ans" ] && ans=other
170 if [ "X$ans" = "X?" ]
173 BEGIN { text = "# ???" }
174 /^[a-z]/ { printf "%-16.16s %s\n",$1,text; text = "# ???"; next }
183 # expert mode, groups are on the command line
187 if grep "^$g[ ]" group >/dev/null
191 echo "Warning: group \"$g\" not defined in ./group"
197 echo -n "Adding $id to group index ..."
198 echo "$id $ans" >>group