Re: Feedback on lsb fhs test suite
And one more thought (btw I like to parameterize and script all
setup so its repeatable)
If you plan to run the VSX-PCTS tests, the requirements for setting
up the user and groups are a little more onerous (due to the
fact that it tests the groups and uid functionality), ie you need
to setup three users and three groups, and put the vsx0 user
in the maximum number of supplementary groups.
Attached is a script using useradd and groupadd to set up
the correct groups under RH6.0 . Note that in this example
it uses ksh as the default shell (i usually install the
the pdksh, that's just a personal preference, i expect that the
default bash should also do fine apart from the echo \c usage,
we should probably update the script to use printf which is more
portable).
regards
Andrew
#!/bin/sh
#
# uids.setup - suitable for vsx4.2.2 and later
#
# Copyright 1992 UNIX System Laboratories Europe, Ltd (USLE)
#
# Permission to use, copy, modify, and distribute this software
# for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of USLE not be used in
# advertising or publicity pertaining to distribution of the software
# without specific, written prior permission. USLE make
# no representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.
#
# USLE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL USLE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# DESCRIPTION
#
# uids.setup - installs groups and user-ids using UNIX System V commands,
# and also install a default setup file.
#
# this should be executed from the directory where the script resides
#
# this version known to work on Redhat 6.0
# see embedded comments below
# ensure we can find the useradd/groupadd utilities
PATH=$PATH:/usr/sbin
export PATH
x=`pwd`
cd ../..
HM=`pwd`
cd $x
echo "This script adds the groups and user-ids necessary to run"
echo "the X/Open Verification Suite Release 4.2.2 and later"
echo "Enter VSX directory (typically /home/tet/vsx4) [default: $HM] \c"
read y
if [ x$y != "x" ] ; then
HM=$y
fi
cd $HM/..
HM2=`pwd`
cd $x
echo "Please give an alternate home directory for the user vsx1"
echo "This directory should be different to the vsx0 user"
echo "[Default is: $HM2] \c"
read z
if [ x$z != "x" ] ; then
HM2=$z
fi
#
# If you have sample params.data files you could load them up here
#cp $HM/vsxdev/vsx4files/vp.dest.pg3 $HM/SRC/install/params.data/SVR4.2
#cp $HM/vsxdev/vsx4files/vp.xae.pg4 $HM/SRC/install/params.data/SVR4.2.XAE
#cp $HM/vsxdev/vsx4files/vp.esmp.posix $HM/SRC/install/params.data/UW2.POSIX
#cp $HM/vsxdev/vsx4files/vp.esmp.pg4 $HM/SRC/install/params.data/UW2
#needs to match the maximum number of supplementary groups
echo "Adding the groups"
set -x
groupadd vsxg0
groupadd vsxg1
groupadd vsxg2
groupadd supp1
groupadd supp2
groupadd supp3
groupadd supp4
groupadd supp5
groupadd supp6
groupadd supp7
groupadd supp8
groupadd supp9
groupadd supp10
groupadd supp11
groupadd supp12
groupadd supp13
groupadd supp14
groupadd supp15
groupadd supp16
groupadd supp17
groupadd supp18
groupadd supp19
groupadd supp20
groupadd supp21
groupadd supp22
groupadd supp23
groupadd supp24
groupadd supp25
groupadd supp26
groupadd supp27
groupadd supp28
groupadd supp29
groupadd supp30
groupadd supp31
set +x
echo "Adding the users"
set -x
# below I'm selecting /usr/bin/ksh - the pdksh
useradd -g vsxg0 -G supp1,supp2,supp3,supp4,supp5,supp6,supp7,supp8,supp9,supp10,supp11,supp12,supp13,supp14,supp15,supp16,supp17,supp18,supp19,supp20,supp21,supp22,supp23,supp24,supp25,supp26,supp27,supp28,supp29,supp30,supp31 -d $HM -s /usr/bin/ksh -c "VSX0 test login" vsx0
useradd -g vsxg1 -d $HM2 -s /usr/bin/sh -c "VSX1 test login" vsx1
useradd -g vsxg2 -d $HM2 -s /usr/bin/sh -c "VSX2 test login" vsx2
set +x
echo "Enter the password for the vsx0 user"
passwd vsx0
Reply to: