#!/bin/bash #------------------------------------------------------------------------------ set -u function msg () { echo -e "$*"; } function errmsg () { msg "\\nError: ${1-Unknown Error}\\n"; ErrorCount+=1; } function bail () { errmsg "${1-Unknown Error}"; exit "${2:-1}"; } declare TmpFile= TmpFile=$(mktemp) cd /hxdepots/reset || bail "Could not cd to: /hxdepots/reset" if [[ -r reset_sdp.sh.txt ]]; then mv reset_sdp.sh.txt reset_sdp.sh chmod +x reset_sdp.sh fi ./reset_sdp.sh -C > settings.cfg.orig sed -e "s:^OSUSER=.*:OSUSER=cooldude:g" \ -e "s:^OSUSER_HOME=.*:OSUSER_HOME=/home/cooldude:g" \ -e "s:^OSGROUP=.*:OSGROUP=heroes:g" \ -e "s:^P4USER=.*:P4USER=superman:g" \ -e "s:^Instance=.*:Instance=fgs:g" \ settings.cfg.orig > settings.cfg ./reset_sdp.sh -c settings.cfg -fast -no_ssl -no_sd -no_ppr 2>&1 | tee log.reset_sdp.test_settings.txt msg "Checking that OS user cooldude got created, doing: id -u cooldude" if id -u cooldude; then msg "Verified: OS User cooldude exists." else msg "Error: OS User cooldude does NOT exist." exit 1 fi msg "Checking that P4USER superman is configured." su - cooldude -c "/p4/common/bin/p4master_run fgs p4 set -q P4USER" > "$TmpFile" if grep superman "$TmpFile"; then msg "Verified: P4USER superman is configured." else msg "Error: P4USER superman is NOT configured." exit 1 fi
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 27288 | C. Thomas Tyler | Removed old Vagrant Test suite. | ||
#6 | 26964 | C. Thomas Tyler | Fixed broken test. | ||
#5 | 26892 | C. Thomas Tyler | Added test for now crontab functionality. | ||
#4 | 26771 | C. Thomas Tyler | Fixed typo. | ||
#3 | 26027 | C. Thomas Tyler | Tweaked test suite to also change OSUSER_HOME dir. | ||
#2 | 26026 | C. Thomas Tyler | Test suite refinements. | ||
#1 | 26021 | C. Thomas Tyler |
Test suite enhancements to better test Configured mode with settings.cfg. |