#!/bin/bash # Tests the SDP - basic tests declare -i ExitCode=0 /p4/reset_sdp.sh sudo ln -f -s /sdp/Server/test/test_SDP.py /p4/test_SDP.py sudo ln -f -s /sdp/Server/test/test_Upgrade.py /p4/test_Upgrade.py if ! python3 /p4/test_SDP.py; then tail /tmp/SDPTest.log exit 1 fi if ! python3 /p4/test_Upgrade.py; then tail /tmp/UpgradeSDPTest.log exit 1 fi #------------------------------------------------------------------------------ # To test extraction of custom logic during SDP upgrade, inject some custom # logic pre-upgrade. Later, we'll test both the extraction and the post- # extraction shell environment load order. echo -e "### MAKE LOCAL CHANGES HERE\\nexport TEST_MESSAGE=Life\\n" >> /p4/common/bin/p4_vars echo -e "### MAKE LOCAL CHANGES HERE\\nexport TEST_MESSAGE+=\" is Good\"\\n" >> /p4/common/config/p4_1.vars #------------------------------------------------------------------------------ # Test SDP Upgrade # This steps are pulled from the 'Upgrading the SDP' section of the SDP # Guide. echo Testing the SDP Upgrade Procedure cd /hxdepots [[ -d downloads ]] || mkdir downloads cd downloads [[ -d new ]] && mv new old.$(date +'%Y%m%d-%H%M') [[ -e sdp.Unix.tgz ]] && mv sdp.Unix.tgz sdp.Unix.old.$(date +'%Y%m%d-%H%M%S') curl -s -k -O https://swarm.workshop.perforce.com/projects/perforce-software-sdp/download/downloads/sdp.Unix.tgz mkdir new cd new tar -xzf ../sdp.Unix.tgz rsync -a /hxdepots/sdp/ /hxdepots/downloads/new/sdp cd /hxdepots/downloads/new/sdp/Server/Unix/p4/common/sdp_upgrade if ./sdp_upgrade.sh -y > /tmp/sdp_upgrade.log 2>&1; then echo SDP Upgrade OK. else echo SDP Upgrade FAILED. tail /tmp/sdp_upgrade.log exit 1 fi #------------------------------------------------------------------------------ # Call verify_sdp.sh after the SDP upgrade. echo Calling verify_sdp.sh after the SDP Upgrade. if /p4/common/bin/verify_sdp.sh 1 > /tmp/post_upgrade_verify.log 2>&1; then echo SDP Post-Upgrade Verify Completed OK. else echo SDP Post-Upgrade Verify FAILED. tail /tmp/post_upgrade_verify.log exit 1 fi #------------------------------------------------------------------------------ # Test extraction of custom logic after SDP upgrade. for c in p4_vars.local p4_1.vars.local; do if [[ -r "/p4/common/site/config/$c" ]]; then echo "Found expected post-upgrade extracted file: $c" else echo "FAILED: Missing expected post-upgrade extracted file: $c" ExitCode=1 fi done source /p4/common/bin/p4_vars 1 Output=$(echo $TEST_MESSAGE) if [[ "$Output" == *"Life is Good"* ]]; then echo "Post-upgrade Test Message is as expected: $Output" else echo "FAILED: Post-upgrade Test Message is not as expected: $Output" ExitCode=1 fi exit "$ExitCode"
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 29612 | C. Thomas Tyler |
Released SDP 2023.1.29610 (2023/05/25). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#6 | 28858 | C. Thomas Tyler |
Released SDP 2022.1.28855 (2022/05/27). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#5 | 28412 | C. Thomas Tyler |
Released SDP 2021.2.28410 (2021/11/24). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#4 | 28259 | C. Thomas Tyler |
Released SDP 2021.1.28253 (2021/11/13). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#3 | 28240 | C. Thomas Tyler |
Released SDP 2021.1.28238 (2021/11/12). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#2 | 25596 | C. Thomas Tyler |
Released SDP 2019.2.25594 (2019/05/02). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
#1 | 25279 | C. Thomas Tyler |
Released SDP 2019.1.25276 (2019/03/06). Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'. |
||
//guest/perforce_software/sdp/dev/test/docker/files/test_sdp.sh | |||||
#1 | 25258 | Robert Cowham |
Rework the containers in preparation for multi container testing mkrep changes: Remove -c cfg option which was unused anyway Converted tabs to spaces Fixed logic error causing forwarding replicas to bail due to unsupported p4d version Standby servers require ReplicatingFrom field Add seconds to log file name (useful for testing to avoid overwriting files) |