#!/bin/bash #------------------------------------------------------------------------------ # test_sc.sh: Scrpt for testing snapclone.sh. # Requires Perforce Sample Depot configured with the Helix Installer default, # with p4d server running locally with P4PORT ssl:1999, and passwords for # users quinn, earl, and bruno all set to: F@stSCM! # # This scripts sets up three DVCS repos, each copied from a template # with rsync, simulating use of a NetApp snapshot to clone the user # workspace. # The user must have enough sudo access to do a 'chown -R' command on # the .p4root directory after the copy. This is not simulated in this # version set -u function msg () { echo -e "$*"; } function bail () { msg "Error: $1"; exit ${2:-1}; } function cmd () { msg "Executing: $*"; $*; return $?; } function usage () { msg "Usage:\n\t${0##*/}\n"; exit 1; } H1="==============================================================================" H2="------------------------------------------------------------------------------" declare Version=1.0.3 declare -a TestUsers declare -a User declare -i i=0 TestUsers[0]=quinn TestUsers[1]=earl TestUsers[2]=bruno #------------------------------------------------------------------------------ # Environment control, including environment hijacking defense. source /p4/common/bin/p4_vars 1 export P4ENVIRO=/dev/null/.p4enviro export P4CONFIG=${P4CONFIG:-.p4config} export P4CONFIG=${P4CONFIG##*/} export P4TICKETS=/p4/1/tmp/u/.p4tickets.tsc export P4TRUST=/p4/1/tmp/u/.p4trust.tsc TestPassword='F@stSCM!' PasswordFile=/tmp/.passwd.$$.$RANDOM echo -e "$TestPassword" > $PasswordFile while [[ $i -lt ${#TestUsers[@]} ]]; do User=${TestUsers[$i]} msg "Setting password and logging in for $User." p4 -u $User login < $PasswordFile cmd flexclone.sh -u $User -p jam -f -P 'F@stSCM!' i=$((i+1)) done rm -f $PasswordFile
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 20119 | Perforce maintenance | Renamed test script to indicate that it needs root access. | ||
#4 | 20113 | Perforce maintenance |
Modified test_sc.sh to run as root. Coordinated with this change: * Created earl, bruno, and quinn OS accounts on this machine. * Changed ownership of snapclone.sh to perforce:users. * Changed perms of snapclone.sh to 750, allowing group execution. * Changed ownership of /netapp/p4 to perforce:users, with 750 perms. * Changed ownership of /netapp/p4/ws to perforce:users, with 770 perms. * Added /etc/profile.d/snapclone.sh file, which just appends /netapp/p4/bin (where snapclone.sh is) to PATH for all users. |
||
#3 | 20112 | Perforce maintenance | Tweaked var def'n. | ||
#2 | 20090 | Perforce maintenance | Adjusted storage location. | ||
#1 | 19956 | Perforce maintenance | Refactored. | ||
//guest/tom_tyler/snapclone/main/tflex.sh | |||||
#2 | 19954 | Perforce maintenance | Added notes. | ||
#1 | 19953 | Perforce maintenance |
flexclone.sh is taking shape. Added test script. |