#!/bin/bash set -u function msg () { echo -e "$*"; } function cmd () { echo -e "Executing: $*"; $*; return $?; } function bail () { echo -e "\nError: ${1:-Unkown Error}\n"; exit ${2:-1}; } export TestID=${1:-1} export P4BIN=${2:-p4} export P4PORT=${3:-1666} export P4USER=${4:-bruno} export P4CLIENT=TestWS.$TestID export P4CONFIG=/tmp/.p4config.$TestID declare -i ExitCode=0 declare TmpFile=/tmp/tmpFile.$TestID.$$.$RANDOM declare RootDir=/tmp/$P4CLIENT declare SSTFile=DeepThought-Components.cbdsst declare MainlineStream=//DeepThought/Components/main declare DevStream=//DeepThought/Components/dev declare ToolsMainlineStream=//tools/admin/main echo -e "Running Test $TestID\n$0 $*\n" /bin/rm -f "$P4CONFIG" echo -e "P4PORT=$P4PORT\nP4USER=$P4USER\nP4CLIENT=$P4CLIENT\nP4IGNORE=.p4ignore\nP4TICKETS=$PWD/.p4tickets\nP4ENVIRO=$PWD/.p4enviro\nP4TRUST=$PWD/.p4trust" > $P4CONFIG echo -e "Wrote this P4CONFIG file $P4CONFIG:\n$(cat $P4CONFIG)" if [[ -n "$($P4BIN -ztag -F %change% changes -m 1 //tools/...)" ]]; then msg "Cleanup from earlier runs with 'p4 obliterate'" cmd $P4BIN -s obliterate -y //tools/... cmd $P4BIN -s stream -d $ToolsMainlineStream cmd $P4BIN depot -d tools fi echo -e "Depot: tools\n Owner: bruno\n Description:\n\tTools depot.\n Type: stream\n StreamDepth: //tools/1/2\n Map: tools/...\n" > $TmpFile $P4BIN -s depot -i < $TmpFile || bail "Failed to load depot tools with this spec:\n$(cat $TmpFile)\n"; msg "Creating mainline stream $ToolsMainlineStream." $P4BIN stream -t mainline -o $ToolsMainlineStream | grep -v '^#' > $TmpFile msg "Loading this stream spec:\n$(cat $TmpFile)\n" $P4BIN -s stream -i < $TmpFile || bail "Failed to create stream $ToolsMainlineStream." msg "Creating branch spec InitTools." echo -e "Branch: InitTools\n\nDescription:\n\tBranch to populate tools depot.\n\nView:\n\t//system/... $ToolsMainlineStream/...\n\n" | $P4BIN branch -i cmd $P4BIN -s populate -b InitTools echo -e "Client: $P4CLIENT\n\nOwner: bruno\n\nRoot: $RootDir\n\nStream: $DevStream\n\n" > $TmpFile $P4BIN -s client -i < $TmpFile || bail "Failed to create workspace [$P4CLIENT]." msg "Initial sync to to create workspace root dir." cmd $P4BIN -s -c $P4CLIENT sync -q || bail "Failed to sync in workspace $P4CLIENT." cd $RootDir || bail "Could not cd to workspace $P4CLIENT root dir $RootDir." msg "Adding import entries to dev stream $DevStream." cmd $P4BIN edit $SSTFile echo -e "Stream: $DevStream\n\nOwner: bruno\n\nName: dev\n\nParent: $MainlineStream\n\nType: development\n\nDescription:\n\tStream spec for //DeepThought/Components/dev.\n\nPaths:\n\tshare ...\n\timport gwt-stream/... //gwt-streams/release1.5/...@12050\n\timport pb/... //pb/1.5.1-p/...@8906\n\timport tools/... $ToolsMainlineStream/...\n\n" > $SSTFile cmd p4 submit -d AddingImports $SSTFile msg Sync again with imports added. cmd $P4BIN -s -c $P4CLIENT sync -q || bail "Failed to sync in workspace $P4CLIENT." ExitCode=$? # The exit code is for the 'p4 sync' command; that's what matters for this test. exit $ExitCode
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19870 | stephan_herter | "Forking branch main of perforce-software-cbd to stephan_herter-cbd." | ||
//guest/perforce_software/cbd/main/test/shared/scripted_test_6.sh | |||||
#1 | 19429 | C. Thomas Tyler | Released CBD/MultiArch/2016.2/19425 (2016/05/17). | ||
//guest/perforce_software/cbd/dev/test/shared/scripted_test_6.sh | |||||
#1 | 19424 | C. Thomas Tyler |
Added Tests 42 and 43 for sync using StreamDepth>1 and a stream spec using an import entry, including importing from a second stream depot, //tools, with StreamDepth>1. Test 42 succeeds (as expected), and test 43 fails (also as expected, until the fix goes in). |