# Test Data File for Command Line tests. # # Each test is a one-line entry of the form: # # ||||| # # Where: # is an arbitrary name used to apply to a group of tests, allowing that group # of tests to be executed independently of other configured tests. By default, all # tests are executed; call run_cli_tests.sh with '-g ' to indicate that the # specified group of tests are to be run. This is intended to speed up interactive testing # for a focused group of tests. # # is the Perforce command to execute. If it starts with 'p4 ', the # 'p4 ' wll be substituted at runtime with 'p4 -p -u -c ', # where the port/user/client values are dependint test configuration data in # test_sdp.*.cfg files. # # Alternately, the can start with 'p4:user:client ', to execute # commands as a user or in a workspace defined in the test entry. The user # is typically 'bruno' or some other user from the Perforce Sample Depot data set. # # If the does not start with 'p4 ' or 'p4:user:client ', it is deemed # to be an arbitrary command and it is executed as is. # # The value can also be the special value 'no_cmd', meaning that no # test command is executed. This allows additional checks of logs to be done based # on the execution of the most recent executed test. # # is the expected exit code, which must be a whole number (integer 0 or # greater). If the actual test exist code is not match, the test is deemed to have # failed. A special value of 'U' meaning Undefined can be given rather than a # whole number to indicate that any exit code is accepted. (The test may still fail # depending on the ). A special value of 'N' can be given to indicate that # any non-zero exit code is accepted. # # Specify the absolute path to the log containing the expected string, # or the special value 'output' to scan the output of the command rather than # a log file. # # is a string of text expected of the executed command in # either the ouptutor a given logfile. The string can be a regular expression. # # are short comments for the human reviewer of the test, describing what # is expected in the output, what is being tested, etc. #------------------------------------------------------------------------------ # Some of the defined "tests" are test setup, such as the call to DANGER_CLEAN.sh # and install of the latest version of install_sdp.sh into /root/install_sdp. # Each test group is intended to be executable independently. Thus, there is # redundacy of test setup in each group. #------------------------------------------------------------------------------ # Setup and basic tests of usage massage and early abort. Usage|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. Usage|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. Usage|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -h|2|output||Usage synopsis for install_sdp.sh Usage|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -man|2|output|DESCRIPTION|Usage: Full man page for install_sdp.sh. Usage|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -empty -bogus_option|2|output|USAGE ERROR|Usage: Bogus usage test. Usage|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -empty -init|2|output|USAGE ERROR: Specify exactly one of|Usage: Using more than one data handling parameter; abort expected. Usage|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -init -sampledepot|2|output|USAGE ERROR: Specify exactly one of|Usage: Using more than one data handling parameter; abort expected. Usage|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -empty -ued -init|2|output|USAGE ERROR: Specify exactly one of|Usage: Using more than one data handling parameter; abort expected. #------------------------------------------------------------------------------ # Test preflight abort. PreflightAbort|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. PreflightAbort|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. PreflightAbort|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. PreflightAbort|mkdir /opt/perforce/p4-sdp|0|output||Test Setup Step: Create /opt/perforce/p4-sdp directory; next call to install_sdp.sh should abort. PreflightAbort|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -demo -empty -no_cron -no_ppr -no_firewall -no_sudo|N|/root/install_sdp/install_sdp.log|Aborting because|Preflight abort test #------------------------------------------------------------------------------ # SDP Install Dry Run. DryRun|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. DryRun|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. DryRun|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. DryRun|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -demo -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall -no_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Dry Run. DryRun|no_cmd|0|/root/install_sdp/install_sdp.log|rsync -a --exclude=.p4root --exclude=.p4config.local --exclude=.p4ignore.local /opt/perforce/p4-sdp/sdp/ /opt/perforce/p4-sdp/p4/sdp|Check that the rsync looks right. #------------------------------------------------------------------------------ # SDP Install Test - Online Basic OnlineInstallBasic|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. OnlineInstallBasic|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. OnlineInstallBasic|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. OnlineInstallBasic|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Online. OnlineInstallBasic|no_cmd|0|/root/install_sdp/install_sdp.log|^Online mode|Verify online mode. OnlineInstallBasic|no_cmd|0|/root/install_sdp/install_sdp.log|^Acquiring binary /opt/perforce/p4-sdp/p4_binaries/p4d|Verify p4d downloaded. #------------------------------------------------------------------------------ # SDP Install Test - Online Basic with Old P4D OnlineInstallBasicOldP4D|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. OnlineInstallBasicOldP4D|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. OnlineInstallBasicOldP4D|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. OnlineInstallBasicOldP4D|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -C > sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=|Test generation of sdp_install.cfg config file. OnlineInstallBasicOldP4D|sed -E -i -e s/^P4BinRel=.*/P4BinRel=r25.1/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=r25.1|Test setup: Change target p4d version to r25.1. OnlineInstallBasicOldP4D|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -c sdp_install.cfg -y -demo -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Online with old P4D. OnlineInstallBasicOldP4D|no_cmd|0|/root/install_sdp/install_sdp.log|^Online mode|Verify online mode. OnlineInstallBasicOldP4D|no_cmd|0|/root/install_sdp/install_sdp.log|^Acquiring binary /opt/perforce/p4-sdp/p4_binaries/p4d|Verify p4d downloaded. OnlineInstallBasicOldP4D|su - perforce -c '/p4/common/bin/p4d -V'|0|output|/2025.1/|Confirm old binary was installed. #------------------------------------------------------------------------------ # SDP Install Test - Online with Sample Depot OnlineInstallWithSD|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. OnlineInstallWithSD|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. OnlineInstallWithSD|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. OnlineInstallWithSD|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -d -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Online with Sample Depot. OnlineInstallWithSD|no_cmd|0|/root/install_sdp/install_sdp.log|^Online mode|Verify online mode. OnlineInstallWithSD|no_cmd|0|/root/install_sdp/install_sdp.log|^Acquiring binary /opt/perforce/p4-sdp/p4_binaries/p4d|Verify p4d downloaded. OnlineInstallWithSD|no_cmd|0|/root/install_sdp/install_sdp.log|Sample Depot configured successfully for instance 1|Verify Sample Depot load. OnlineInstallWithSD|su - perforce -c /p4/common/bin/p4sanity_check.sh|0|output|PASS: Sanity checks look OK|Sanity check on Sample Depot server. OnlineInstallWithSD|su - perforce -c /p4/common/bin/p4verify.sh|U|/p4/1/logs/p4verify.log|Submitted File Errors:.*0|Depot load check. OnlineInstallWithSD|su - perforce -c '/p4/common/bin/verify_sdp.sh -online -skip cron,license'|0|/p4/1/logs/verify_sdp.log||SDP verify check. #------------------------------------------------------------------------------ # Local Install Test - Empty Depot and No Init LocalInstallEmptyNoSystemdOrSudo|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallEmptyNoSystemdOrSudo|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallEmptyNoSystemdOrSudo|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallEmptyNoSystemdOrSudo|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -local -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall -no_sudo -no_systemd|N|/root/install_sdp/install_sdp.log|Aborting|SDP Install Dry Run - Basic Local, abort expected. LocalInstallEmptyNoSystemdOrSudo|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallEmptyNoSystemdOrSudo|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallEmptyNoSystemdOrSudo|cd /root && rsync -a --exclude=.p4root --exclude=.p4config.local /opt/perforce/dev/sdp/ /opt/perforce/p4-sdp/downloads/sdp|0|output||Test Setup: Get SDP dir LocalInstallEmptyNoSystemdOrSudo|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -local -demo -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall -no_sudo -no_systemd|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local, No Init or sudoers. LocalInstallEmptyNoSystemdOrSudo|su - perforce -c '/p4/common/bin/verify_sdp.sh -skip p4root,offline_db,p4t_files,cron'|0|/p4/1/logs/verify_sdp.log|ALL CLEAN:|SDP Install Live Run - Basic Local. LocalInstallEmptyNoSystemdOrSudo|[[ ! -r /etc/sudoers.d/perforce ]]|0|output||Ensure no sudoers file for perforce per -no_sudo. LocalInstallEmptyNoSystemdOrSudo|[[ ! -r /etc/systemd/system/p4d_1.service ]]|0|output||Ensure p4d_1.service is not available per '-no_sudo'. LocalInstallEmptyNoSystemdOrSudo|[[ ! -r /etc/systemd/system/p4broker_1.service ]]|0|output||Ensure p4broker_1.service is not available per '-no_sudo'. #------------------------------------------------------------------------------ # Local Install Test - Empty Depot LocalInstallEmpty|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallEmpty|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallEmpty|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallEmpty|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -local -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall|N|/root/install_sdp/install_sdp.log|Aborting|SDP Install Dry Run - Basic Local, abort expected. LocalInstallEmpty|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallEmpty|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallEmpty|cd /root && rsync -a --exclude=.p4root --exclude=.p4config.local /opt/perforce/dev/sdp/ /opt/perforce/p4-sdp/downloads/sdp|0|output||Test Setup: Get SDP dir LocalInstallEmpty|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -local -demo -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall |0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local. LocalInstallEmpty|su - perforce -c '/p4/common/bin/verify_sdp.sh -skip p4root,offline_db,p4t_files,cron'|0|/p4/1/logs/verify_sdp.log|ALL CLEAN:|SDP Install Live Run - Basic Local. #------------------------------------------------------------------------------ # Local Install Test - Empty and No Broker LocalInstallEmptyNoBroker|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallEmptyNoBroker|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallEmptyNoBroker|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallEmptyNoBroker|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallEmptyNoBroker|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallEmptyNoBroker|cd /root && rsync -a --exclude=.p4root --exclude=.p4config.local /opt/perforce/dev/sdp/ /opt/perforce/p4-sdp/downloads/sdp|0|output||Test Setup: Get SDP dir LocalInstallEmptyNoBroker|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -C > sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=|Test generation of sdp_install.cfg config file. LocalInstallEmptyNoBroker|sed -E -i -e 's@^DeployBrokerWithP4D=.*@DeployBrokerWithP4D=0@g' /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^DeployBrokerWithP4D=0|Test Setup: Set to drop the broker for this test. LocalInstallEmptyNoBroker|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -local -c sdp_install.cfg -demo -d -empty -sdp_dir /opt/perforce/dev/sdp -no_cron -no_ppr -no_firewall|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local, No Init or sudoers. LocalInstallEmptyNoBroker|su - perforce -c '/p4/common/bin/verify_sdp.sh -skip p4root,offline_db,p4t_files,cron'|0|/p4/1/logs/verify_sdp.log|ALL CLEAN:|SDP Install Live Run - Basic Local. LocalInstallEmptyNoBroker|[[ ! -r /p4/1/bin/p4broker_1_init ]]|0|output||Ensure no p4broker_1_init file per config option DeployBrokerWithP4D=0. LocalInstallEmptyNoBroker|[[ ! -r /p4/common/config/p4_1.broker.cfg ]]|0|output||Ensure no p4_1.broker.cfg file per config option DeployBrokerWithP4D=0. LocalInstallEmptyNoBroker|[[ -r /etc/systemd/system/p4d_1.service ]]|0|output||Ensure p4d_1.service is available. LocalInstallEmptyNoBroker|[[ ! -r /etc/systemd/system/p4broker_1.service ]]|0|output||Ensure p4broker_1.service is not available per config option DeployBrokerWithP4D=0. #------------------------------------------------------------------------------ # Local Install Test - Initialize Data Set LocalInstallInitData|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallInitData|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallInitData|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallInitData|cd /root && rsync -a --exclude=.p4root --exclude=.p4config.local /opt/perforce/dev/sdp/ /opt/perforce/p4-sdp/downloads/sdp|0|output||Test Setup: Get SDP dir LocalInstallInitData|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallInitData|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallInitData|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -init -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local. LocalInstallInitData|no_cmd|0|/root/install_sdp/install_sdp.log|New sudoers file successfully installed.|Verify sudoers. LocalInstallInitData|no_cmd|0|/etc/sudoers.d/perforce|Cmnd_Alias P4_SVC|Sudoers file sanity check. LocalInstallInitData|no_cmd|0|/root/install_sdp/install_sdp.log|User perforce saved|Verify perforce P4USER created. LocalInstallInitData|no_cmd|0|/root/install_sdp/install_sdp.log|Protections saved.|Verify Protections updated. LocalInstallInitData|no_cmd|0|/root/install_sdp/install_sdp.log|Group Automation created.|Verify Automation group created. LocalInstallInitData|no_cmd|0|/root/install_sdp/install_sdp.log|Depot spec saved.|Verify spec depot created. LocalInstallInitData|no_cmd|0|/root/install_sdp/install_sdp.log|Depot unload saved.|Verify unload depot created. LocalInstallInitData|ls -lrt /root/install_sdp|0|output|install_sdp.sh|Test Setup: Confirm /root/sdp_install still there BEFORE DANGER_CLEAN.sh with '-ued'. LocalInstallInitData|/opt/perforce/dev/bin/DANGER_CLEAN.sh -ued -y|0|output|Skipping cleanup of mount points and backup dirs due to '-ued'|Test Setup: Remove all SDP structures except mount points so we can test '-ued' next. LocalInstallInitData|ls -lrt /root/install_sdp|0|output|install_sdp.sh|Test Setup: Confirm /root/sdp_install still there AFTER DANGER_CLEAN.sh with '-ued'. LocalInstallInitData|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallInitData|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallInitData|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -ued -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Local using '-ued' to use Sample Depot from an earlier install. ### This test of 'p4 monitor show -L' works on Rocky 9, SLES, and Ubuntu 20.04, but fails on Ubuntu 22.04 and Ubuntu 24.04. ### The test doesn't actually "fail", but instead it found a real issue in p4d. ### For deets, see: https://perforce.slack.com/archives/C8PSLC9RD/p1752967022022109 ###LocalInstallInitData|su - perforce -c 'p4 monitor show -L'|0|output|db1|Verify 'p4 monitor show -L' works. #------------------------------------------------------------------------------ # Local Install Test - Initialize Data Set with Config Changes LocalInstallInitDataConfigChg|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallInitDataConfigChg|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallInitDataConfigChg|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallInitDataConfigChg|cd /root && rsync -a --exclude=.p4root --exclude=.p4config.local /opt/perforce/dev/sdp/ /opt/perforce/p4-sdp/downloads/sdp|0|output||Test Setup: Get SDP dir LocalInstallInitDataConfigChg|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallInitDataConfigChg|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallInitDataConfigChg|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -C > sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=|Test generation of sdp_install.cfg config file. LocalInstallInitDataConfigChg|sed -E -i -e s/^CaseSensitive=1/CaseSensitive=0/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^CaseSensitive=0|Test Setup: Change config to case insensitive. LocalInstallInitDataConfigChg|sed -E -i -e s/^Instance=1/Instance=fgs/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^Instance=fgs|Test Setup: Change SDP instance to fgs. LocalInstallInitDataConfigChg|sed -E -i -e s/^ServerID=.*/ServerID=commit.fgs/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^ServerID=commit.fgs|Test Setup: Change Commit ServerID to commit.fgs. LocalInstallInitDataConfigChg|sed -E -i -e 's+^Password=.*+Password=Complex$u.t$a!#%3$CRx+g' /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^Password=Complex|Test Setup: Change Password to something complex. LocalInstallInitDataConfigChg|sed -E -i -e 's@^UseEncryptedPassword=.*@UseEncryptedPassword=0@g' /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^UseEncryptedPassword=0|Test Setup: Set to use cleartext password for this test. LocalInstallInitDataConfigChg|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -c sdp_install.cfg -init -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local with Config Changes. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|New sudoers file successfully installed.|Verify sudoers. LocalInstallInitDataConfigChg|no_cmd|0|/etc/sudoers.d/perforce|Cmnd_Alias P4_SVC|Sudoers file sanity check. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|User perforce saved|Verify perforce P4USER created. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|Protections saved.|Verify Protections updated. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|Group Automation created.|Verify Automation group created. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|Depot spec saved.|Verify spec depot created. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|Depot unload saved.|Verify unload depot created. LocalInstallInitDataConfigChg|no_cmd|0|/root/install_sdp/install_sdp.log|/p4/fgs/root|Verify P4ROOT for fgs instance. LocalInstallInitDataConfigChg|no_cmd|0|/p4/common/config/.p4passwd.p4_fgs.admin|Complex|Verify complex password was set. LocalInstallInitDataConfigChg|[[ ! -r /p4/common/config/.p4passwd.p4_fgs.admin.enc ]]|0|output||Ensure encrypted password file does not exist in cleartext mode. LocalInstallInitDataConfigChg|[[ -r /p4/common/config/.p4passwd.p4_fgs.admin ]]|0|output||Ensure cleartext password file exists in cleartext mode. LocalInstallInitDataConfigChg|grep -q Complex /p4/common/config/.p4passwd.p4_fgs.admin|0|output||Ensure cleartext password file contains unencrypted password. #------------------------------------------------------------------------------ # Local Install Test - Initialize Data Set with Config Changes LocalInstallSampleDepotDeepCfgChanges|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallSampleDepotDeepCfgChanges|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallSampleDepotDeepCfgChanges|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallSampleDepotDeepCfgChanges|cd /root && rsync -a /root/downloads/ /opt/perforce/p4-sdp/downloads|0|output||Test Setup: Get Sample Depot tarball. LocalInstallSampleDepotDeepCfgChanges|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallSampleDepotDeepCfgChanges|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallSampleDepotDeepCfgChanges|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -C > sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=|Test generation of sdp_install.cfg config file. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s/^P4BinRel=.*/P4BinRel=r25.1/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=r25.1|Test setup: Change target p4d version to r25.1. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s/^P4USER=.*/P4USER=p4admin/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4USER=p4admin|Test Setup: Change SDP P4USER to p4admin. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s/^Instance=1/Instance=fgs/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^Instance=fgs|Test Setup: Change SDP instance to fgs. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s/^ServerID=.*/ServerID=commit.fgs/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^ServerID=commit.fgs|Test Setup: Change Commit ServerID to commit.fgs. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s@^P4Depots=.*@P4Depots=/BigDisk@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4Depots=/BigDisk|Test Setup: Change /mnt/p4depots -> /BigDisk. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s@^P4Checkpoints=.*@P4Checkpoints=/BigDisk@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4Checkpoints=/BigDisk|Test Setup: Change P4Checkpoints -> /BigDisk. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s@^P4DB1=.*@P4DB1=/DBs@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4DB1=/DBs|Test Setup: Change /mnt/p4db-1 -> /DBs. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s@^P4DB2=.*@P4DB2=/DBs@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4DB2=/DBs|Test Setup: Change /mnt/p4db-2 -> /DBs. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s@^P4Logs=.*@P4Logs=/Journals@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4Logs=/Journals|Test Setup: Change /mnt/p4logs -> /Journals. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s/^OSUSER=.*/OSUSER=dude/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSUSER=dude|Test Setup: Change OSUSER from perforce to dude. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s@^OSUSER_HOME=.*@OSUSER_HOME=/home/dude@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSUSER_HOME=/home/dude|Test Setup: Change OSUSER_HOME from /home/perforce to /home/dude. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e s/^OSGROUP=.*/OSGROUP=p4admin/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSGROUP=p4admin|Test Setup: Change OSGROUP from perforce to p4admin. LocalInstallSampleDepotDeepCfgChanges|sed -E -i -e 's/^OSUSER_ADDITIONAL_GROUPS=.*/OSUSER_ADDITIONAL_GROUPS=p4staff friends/g' /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSUSER_ADDITIONAL_GROUPS=p4staff|Test Setup: Change OSUSER_ADDITIONAL_GROUPS from empty to p4staff friends. LocalInstallSampleDepotDeepCfgChanges|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -c sdp_install.cfg -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|1|/root/install_sdp/install_sdp.log|Error: OSUSER_ADDITIONAL_GROUPS group p4staff does not exist|SDP Install Live Run with missing group; failure expected. LocalInstallSampleDepotDeepCfgChanges|groupadd p4staff|0|output||Test Setup: Create group p4staff. LocalInstallSampleDepotDeepCfgChanges|groupadd friends|0|output||Test Setup: Create group friends. LocalInstallSampleDepotDeepCfgChanges|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -c sdp_install.cfg -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Local Sample Depot with Deep Config Changes. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|New sudoers file successfully installed.|Verify sudoers. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/etc/sudoers.d/dude|Cmnd_Alias P4_SVC|Sudoers file sanity check. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|User p4admin saved|Verify p4admin P4USER created. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|Protections saved.|Verify Protections updated. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|Group Automation created.|Verify Automation group created. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|Depot spec saved.|Verify spec depot created. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|Depot unload saved.|Verify unload depot created. LocalInstallSampleDepotDeepCfgChanges|no_cmd|0|/root/install_sdp/install_sdp.log|/p4/fgs/root|Verify P4ROOT for fgs instance. LocalInstallSampleDepotDeepCfgChanges|systemctl start opt_perforce_sdp_backup.service|0|output||Start backup service. LocalInstallSampleDepotDeepCfgChanges|journalctl -u opt_perforce_sdp_backup.service --no-pager -n 500|0|output|SUCCESS: P4 SDP Backup completed|Confirm Backup successful. #------------------------------------------------------------------------------ # Backup/Recovery with Multiple Instances. Start with Local Install BackupRecoveryMultiInstance|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. BackupRecoveryMultiInstance|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. BackupRecoveryMultiInstance|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. BackupRecoveryMultiInstance|cd /root && rsync -a /root/downloads/ /opt/perforce/p4-sdp/downloads|0|output||Test Setup: Get Sample Depot tarball. BackupRecoveryMultiInstance|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. BackupRecoveryMultiInstance|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. BackupRecoveryMultiInstance|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -C > sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=|Test generation of sdp_install.cfg config file. BackupRecoveryMultiInstance|sed -E -i -e s/^P4BinRel=.*/P4BinRel=r25.1/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4BinRel=r25.1|Test setup: Change target p4d version to r25.1. BackupRecoveryMultiInstance|sed -E -i -e s/^P4USER=.*/P4USER=p4admin/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^P4USER=p4admin|Test Setup: Change SDP P4USER to p4admin. BackupRecoveryMultiInstance|sed -E -i -e s/^Instance=1/Instance=fgs/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^Instance=fgs|Test Setup: Change SDP instance to fgs. BackupRecoveryMultiInstance|sed -E -i -e s/^ServerID=.*/ServerID=commit.fgs/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^ServerID=commit.fgs|Test Setup: Change Commit ServerID to commit.fgs. BackupRecoveryMultiInstance|sed -E -i -e s@^OSUSER_HOME=.*@OSUSER_HOME=/home/dude@g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSUSER_HOME=/home/dude|Test Setup: Change OSUSER_HOME from /home/perforce to /home/dude. BackupRecoveryMultiInstance|sed -E -i -e s/^OSUSER=.*/OSUSER=dude/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSUSER=dude|Test Setup: Change OSUSER from perforce to dude. BackupRecoveryMultiInstance|sed -E -i -e s/^OSGROUP=.*/OSGROUP=p4admin/g /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSGROUP=p4admin|Test Setup: Change OSGROUP from perforce to p4admin. BackupRecoveryMultiInstance|sed -E -i -e 's/^OSUSER_ADDITIONAL_GROUPS=.*/OSUSER_ADDITIONAL_GROUPS=p4staff friends/g' /root/install_sdp/sdp_install.cfg|0|/root/install_sdp/sdp_install.cfg|^OSUSER_ADDITIONAL_GROUPS=p4staff|Test Setup: Change OSUSER_ADDITIONAL_GROUPS from empty to p4staff friends. BackupRecoveryMultiInstance|groupadd p4staff|0|output||Test Setup: Create group p4staff. BackupRecoveryMultiInstance|groupadd friends|0|output||Test Setup: Create group friends. BackupRecoveryMultiInstance|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -c sdp_install.cfg -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Local Sample Depot with Deep Config Changes. BackupRecoveryMultiInstance|sleep 5 && su - dude -c "p4login -v"|0|output||Test Setup: Doing a login to generate a tickets file. BackupRecoveryMultiInstance|[[ -r /p4/fgs/.p4tickets ]]|0|output||Ensure .p4tickets file exists after having done 'p4login -v'. BackupRecoveryMultiInstance|[[ -r /home/dude/.p4-sdp.home_dir_backup ]]|0|output||BackupHomeDir indicator file should exist in 'dude' user home dir. BackupRecoveryMultiInstance|[[ -r /etc/sudoers.d/dude ]]|0|output||Sudoers file should exist due to '-limited_sudoers' install option. BackupRecoveryMultiInstance|grep -q Full /home/dude/.p4-sdp.home_dir_backup|0|output||BackupHomeDir indicator file should be 'Full'. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|New sudoers file successfully installed.|Verify sudoers. BackupRecoveryMultiInstance|no_cmd|0|/etc/sudoers.d/dude|Cmnd_Alias P4_SVC|Sudoers file sanity check. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|User p4admin saved|Verify p4admin P4USER created. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|Protections saved.|Verify Protections updated. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|Group Automation created.|Verify Automation group created. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|Depot spec saved.|Verify spec depot created. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|Depot unload saved.|Verify unload depot created. BackupRecoveryMultiInstance|no_cmd|0|/root/install_sdp/install_sdp.log|/p4/fgs/root|Verify P4ROOT for fgs instance. BackupRecoveryMultiInstance|sed -E -e 's/^OSUSER=.*/OSUSER=dude/g' -e 's/^OSGROUP=.*/OSGROUP=p4admin/g' -e 's/^P4_PORT=.*/P4_PORT=2666/g' -e 's/^P4BROKER_PORT=.*/P4BROKER_PORT=2999/g' -e 's/^MASTER_ID=.*/MASTER_ID=commit.2/g' /p4/sdp/Server/Unix/setup/mkdirs.fgs.cfg > /p4/sdp/Server/Unix/setup/mkdirs.2.cfg|0|/p4/sdp/Server/Unix/setup/mkdirs.2.cfg|OSUSER=dude|Test Setup: Prepare mkdirs.2.cfg. BackupRecoveryMultiInstance|cd /p4/sdp/Server/Unix/setup && ./mkdirs.sh 2 -no_broker|0|output|mkdirs.sh: EXITCODE: 0|Add second SDP instance 2. BackupRecoveryMultiInstance|[[ -x /p4/fgs/bin/p4broker_fgs_init ]]|0|output||Broker init script exists and executable for SDP instance fgs. BackupRecoveryMultiInstance|[[ -r /etc/systemd/system/p4broker_fgs.service ]]|0|output||Broker service exists for SDP instance fgs. BackupRecoveryMultiInstance|[[ ! -r /p4/2/bin/p4broker_2_init ]]|0|output||No broker init script for SDP instance 2. BackupRecoveryMultiInstance|[[ ! -r /etc/systemd/system/p4broker_2.service ]]|0|output||No broker service for SDP instance 2. BackupRecoveryMultiInstance|systemctl start opt_perforce_sdp_backup.service|0|output||Start backup service. BackupRecoveryMultiInstance|journalctl -u opt_perforce_sdp_backup.service --no-pager -n 500|0|output|SUCCESS: P4 SDP Backup completed|Confirm Backup successful. BackupRecoveryMultiInstance|su - dude -c ccheck.sh|0|/p4/fgs/logs/ccheck.log|Result: PASS with Grade|Test ccheck.sh; should pass with grade of A or B. BackupRecoveryMultiInstance|[[ -x /mnt/p4depots/backup/opt_perforce_p4-sdp.${HOSTNAME%%.*}/recover_opt_perforce_sdp.sh ]]|0|output||SDP Recovery Script ready to use. BackupRecoveryMultiInstance|diff /mnt/p4depots/backup/opt_perforce_p4-sdp.${HOSTNAME%%.*}/recover_opt_perforce_sdp*|1|output|/p4/2|Confirm SDP Recovery script backup was created and has expected diffs due to instance 2 being added. BackupRecoveryMultiInstance|rsync -a /var/log/opt_perforce_sdp_backup/ /tmp/opt_perforce_sdp_backup|0|output||Test Support: Copy log from run of opt_perforce_sdp_backup.service to /tmp before DANGER_CLEANS.sh fries it. BackupRecoveryMultiInstance|/opt/perforce/dev/bin/DANGER_CLEAN.sh -ued -y|0|output|Skipping cleanup of mount points and backup dirs due to '-ued'|Test Setup: Remove all SDP structures except mount points so we can test recovery. BackupRecoveryMultiInstance|getent passwd dude|2|output||The user 'dude' should NOT exist after DANGER_CLEAN.sh. BackupRecoveryMultiInstance|getent group p4admin|2|output||The group 'p4admin' should NOT exist after DANGER_CLEAN.sh. BackupRecoveryMultiInstance|[[ ! -d /p4 ]]|0|output||The /p4 directory should NOT exist after DANGER_CLEAN.sh with -ued. BackupRecoveryMultiInstance|[[ ! -d /p4/fgs ]]|0|output||The /p4/fgs directory should NOT exist after DANGER_CLEAN.sh with -ued. BackupRecoveryMultiInstance|[[ ! -f /p4/fgs/.p4tickets ]]|0|output||The /p4/fgs/.p4tickets file should NOT exist after DANGER_CLEAN.sh with -ued. BackupRecoveryMultiInstance|[[ -r /etc/sudoers.d/dude ]]|1|output||Sudoers file should NOT exist after DANGER_CLEAN.sh. BackupRecoveryMultiInstance|mkdir /root/opt_perforce_sdp_backup && cd /root/opt_perforce_sdp_backup && cp /mnt/p4depots/backup/opt_perforce_p4-sdp.${HOSTNAME%%.*}/sdp_backup.${HOSTNAME%%.*}.tgz . && tar -xzvpf sdp_backup.${HOSTNAME%%.*}.tgz && cd opt_perforce_p4-sdp.${HOSTNAME%%.*} && ./recover_opt_perforce_sdp.sh|0|output||Testing recovery procedure as documented in 'opt_perforce_sdp_backup.sh -man' in RECOVERY PROCEDURE section. BackupRecoveryMultiInstance|getent passwd dude|0|output||The user 'dude' should be recovered. BackupRecoveryMultiInstance|getent group p4admin|0|output||The group 'p4admin' should be recovered. BackupRecoveryMultiInstance|[[ -d /p4 ]]|0|output||The /p4 directory should be recovered. BackupRecoveryMultiInstance|[[ -d /p4/fgs ]]|0|output||The /p4/fgs directory should be recovered. BackupRecoveryMultiInstance|[[ -f /p4/fgs/.p4tickets ]]|0|output||The /p4/fgs/.p4tickets file should be recovered. BackupRecoveryMultiInstance|[[ -f /home/dude/.p4aliases ]]|0|output||The ~dude/.p4aliases file should be recovered. BackupRecoveryMultiInstance|[[ -r /etc/sudoers.d/dude ]]|0|output||Sudoers file should be recovered. BackupRecoveryMultiInstance|su - dude -c recreate_offline_db.sh|0|/p4/fgs/logs/recreate_offline_db.log||Test recreate_offline_db.sh after recovery. BackupRecoveryMultiInstance|su - dude -c "timeout 10s sudo systemctl start p4d_fgs" && sleep 5|0|/p4/fgs/logs/p4d_init.log|Starting /p4/fgs/bin/p4d_fgs|Test service start after recovery. ###TO DO: Re-enable this net test after enhancing edge_dump.sh to use the standard LogLink logic. ###BackupRecoveryMultiInstance|su - dude -c "edge_dump.sh fgs p4d_edge_syd"|1|/p4/fgs/logs/edge_dump.log|Could not confirm that p4d_edge_syd is an edge server|Test edge_dump.sh after recovery. #------------------------------------------------------------------------------ # Local Install Test - Initialize Data Set - High Security LocalInstallInitDataHighSec|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallInitDataHighSec|/opt/perforce/dev/bin/toggle_security_features.sh 1|0|output||Test Setup: Emulate Security Hardening LocalInstallInitDataHighSec|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallInitDataHighSec|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallInitDataHighSec|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallInitDataHighSec|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalInstallInitDataHighSec|tss-remove_rsync.sh|U|output||Test Setup: Remove rsync package with apt-get, dnf, or zypper. LocalInstallInitDataHighSec|cd /root/install_sdp && umask 0027 && ./install_sdp.sh -y -demo -local -d -init -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local with umask 0027. LocalInstallInitDataHighSec|no_cmd|0|/root/install_sdp/install_sdp.log|New sudoers file successfully installed.|Verify sudoers. LocalInstallInitDataHighSec|no_cmd|0|/etc/sudoers.d/perforce|Cmnd_Alias P4_SVC|Sudoers file sanity check. LocalInstallInitDataHighSec|no_cmd|0|/root/install_sdp/install_sdp.log|User perforce saved|Verify perforce P4USER created. LocalInstallInitDataHighSec|no_cmd|0|/root/install_sdp/install_sdp.log|Protections saved.|Verify Protections updated. LocalInstallInitDataHighSec|no_cmd|0|/root/install_sdp/install_sdp.log|Group Automation created.|Verify Automation group created. LocalInstallInitDataHighSec|no_cmd|0|/root/install_sdp/install_sdp.log|Depot spec saved.|Verify spec depot created. LocalInstallInitDataHighSec|no_cmd|0|/root/install_sdp/install_sdp.log|Depot unload saved.|Verify unload depot created. #------------------------------------------------------------------------------ # Local Install Test - Initialize Sample Depot LocalInstallWithSD|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalInstallWithSD|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalInstallWithSD|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalInstallWithSD|cd /root && rsync -a /root/downloads/ /opt/perforce/p4-sdp/downloads|0|output||Test Setup: Get Sample Depot tarball. LocalInstallWithSD|cd /root && rsync -a --exclude=.p4root --exclude=.p4config.local /opt/perforce/dev/sdp/ /opt/perforce/p4-sdp/downloads/sdp|0|output||Test Setup: Get SDP dir LocalInstallWithSD|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalInstallWithSD|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. ### These next few lines are intended test the safety feature where we fail ### doing a production install (i.e. not using '-demo') and the SDP mounts ### for /hx{depots,logs,metadata} are not real mount points. However, this ### test will fail to display the expected message if the machine well and ### truly does have valid /hx* mounts. Since this feature is already proven ### and not likley to break, for now we'll comment these tests out. ###LocalInstallWithSD|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -local -d -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr -limited_sudo|N|/root/install_sdp/install_sdp.log|Aborting due to failed storage configuration checks.|Attempt with bad storage for production. ####LocalInstallWithSD|no_cmd|N|/root/install_sdp/install_sdp.log|Error: Directory /mnt/p4depots should be a mounted volume|Missing /mnt/p4depots. ####LocalInstallWithSD|no_cmd|N|/root/install_sdp/install_sdp.log|Error: Directory /mnt/p4db should be a mounted volume|Missing /mnt/p4db. ####LocalInstallWithSD|no_cmd|N|/root/install_sdp/install_sdp.log|Error: Directory /mnt/p4logs should be a mounted volume|Missing /mnt/p4logs. LocalInstallWithSD|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -local -d -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - Basic Local. LocalInstallWithSD|no_cmd|0|/root/install_sdp/install_sdp.log|^Local mode|Verify local mode. LocalInstallWithSD|no_cmd|0|/root/install_sdp/install_sdp.log|Using existing binary: /opt/perforce/p4-sdp/p4_binaries/p4d|Verify existing p4d binary used, no download. LocalInstallWithSD|no_cmd|0|/root/install_sdp/install_sdp.log|Sample Depot configured successfully for instance 1|Verify Sample Depot load. LocalInstallWithSD|no_cmd|0|/p4/1/logs/checkpoint.log|End p4_1 Checkpoint|Verify Sample Depot first checkpoint. LocalInstallWithSD|su - perforce -c /p4/common/bin/p4sanity_check.sh|0|output|PASS: Sanity checks look OK|Sanity check on Sample Depot server. LocalInstallWithSD|su - perforce -c /p4/common/bin/p4verify.sh|U|/p4/1/logs/p4verify.log|Submitted File Errors:.*0|Depot load check. LocalInstallWithSD|su - perforce -c '/p4/common/bin/verify_sdp.sh -online -skip cron,license'|0|/p4/1/logs/verify_sdp.log||SDP verify check. #------------------------------------------------------------------------------ # Online Install Test With Packages And Sample Depot OnlineInstallWithPkgs|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. OnlineInstallWithPkgs|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. OnlineInstallWithPkgs|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. OnlineInstallWithPkgs|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -extra_pkgs -d -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr -no_pkgs|2|output|USAGE ERROR: The '-no_pkgs' and '-extra_pkgs' options are mutually exclusive|SDP Install with package-related usage error. OnlineInstallWithPkgs|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -demo -extra_pkgs -d -sampledepot -sdp_dir /opt/perforce/dev/sdp -no_ppr|0|/root/install_sdp/install_sdp.log|^SUCCESS:|SDP Install Live Run - With Extra Packages OnlineInstallWithPkgs|no_cmd|0|/root/install_sdp/install_sdp.log|^Online mode|Verify online mode. OnlineInstallWithPkgs|no_cmd|0|/root/install_sdp/install_sdp.log|^Acquiring binary /opt/perforce/p4-sdp/p4_binaries/p4d|Verify p4d downloaded. OnlineInstallWithPkgs|no_cmd|0|/root/install_sdp/install_sdp.log|Sample Depot configured successfully for instance 1|Verify Sample Depot load. OnlineInstallWithPkgs|no_cmd|0|/p4/1/logs/checkpoint.log|End p4_1 Checkpoint|Verify Sample Depot first checkpoint. OnlineInstallWithPkgs|su - perforce -c /p4/common/bin/p4sanity_check.sh|0|output|PASS: Sanity checks look OK|Sanity check on Sample Depot server. OnlineInstallWithPkgs|su - perforce -c /p4/common/bin/p4verify.sh|U|/p4/1/logs/p4verify.log|Submitted File Errors:.*0|Depot load check. OnlineInstallWithPkgs|su - perforce -c '/p4/common/bin/verify_sdp.sh -online -skip cron,license'|0|/p4/1/logs/verify_sdp.log||SDP verify check. #------------------------------------------------------------------------------ # Online Proxy Install ProxyInstall|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. ProxyInstall|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. ProxyInstall|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. ProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4p -sdp_dir /opt/perforce/dev/sdp -no_ppr|2|output|ServerType is p4p, but ListenPort is undefined|Proxy install usage error. ProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4p -lp 1666 -sdp_dir /opt/perforce/dev/sdp -no_ppr|2|output|ServerType is p4p, but TargetPort is undefined|Proxy install usage error. ProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4p -lp 1666 -tp public.perforce.com:1666 -sdp_dir /opt/perforce/dev/sdp|0|/root/install_sdp/install_sdp.log|SUCCESS:|Dry Run - Proxy Online Install. ProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -t p4p -lp 1666 -tp public.perforce.com:1666 -sdp_dir /opt/perforce/dev/sdp|0|/root/install_sdp/install_sdp.log|SUCCESS:|Live Run - Proxy Online Install. #------------------------------------------------------------------------------ # Local Proxy Install LocalProxyInstall|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalProxyInstall|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalProxyInstall|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalProxyInstall|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalProxyInstall|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4p -local -sdp_dir /opt/perforce/dev/sdp -no_ppr|2|output|ServerType is p4p, but ListenPort is undefined|Proxy install usage error. LocalProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4p -local -lp 1666 -sdp_dir /opt/perforce/dev/sdp -no_ppr|2|output|ServerType is p4p, but TargetPort is undefined|Proxy install usage error. LocalProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4p -local -lp 1670 -tp ssl:ppn.perforce.com:1670 -sdp_dir /opt/perforce/dev/sdp|0|/root/install_sdp/install_sdp.log|SUCCESS:|Dry Run - Proxy Local Install. LocalProxyInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -t p4p -local -lp ssl:1670 -tp ssl:ppn.perforce.com:1670 -sdp_dir /opt/perforce/dev/sdp -full_sudo|0|/root/install_sdp/install_sdp.log|SUCCESS:|Live Run - Proxy Local Install. LocalProxyInstall|su - perforce -c '/p4/common/bin/verify_sdp.sh -skip p4t_files'|0|/p4/1/logs/verify_sdp.log|ALL CLEAN:|SDP verify check. #------------------------------------------------------------------------------ # Local Broker Install LocalBrokerInstall|/opt/perforce/dev/bin/DANGER_CLEAN.sh -y|0|output||Test Setup: Remove all SDP structures. LocalBrokerInstall|mkdir -p /root/install_sdp|0|output||Test Setup Step: Create /root/install_sdp directory. LocalBrokerInstall|cp -p /opt/perforce/dev/sdp/Server/Unix/setup/install_sdp.sh /root/install_sdp/.|0|output||Test Setup: Copy install_sdp.sh script to /root/install_sdp. LocalBrokerInstall|mkdir -p /opt/perforce/p4-sdp/downloads /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Create dirs for local install. LocalBrokerInstall|cd /root && rsync -a /root/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||Test Setup: Get p4_binaries. LocalBrokerInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4broker -local -sdp_dir /opt/perforce/dev/sdp -no_ppr|2|output|ServerType is p4broker, but ListenPort is undefined|Broker install usage error. LocalBrokerInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4broker -local -lp 1666 -sdp_dir /opt/perforce/dev/sdp -no_ppr|2|output|ServerType is p4broker, but TargetPort is undefined|Broker install usage error. LocalBrokerInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -t p4broker -local -lp 1666 -tp public.perforce.com:1666 -sdp_dir /opt/perforce/dev/sdp|0|/root/install_sdp/install_sdp.log|SUCCESS:|Dry Run - Broker Install. LocalBrokerInstall|cd /root/install_sdp && umask 0022 && ./install_sdp.sh -y -t p4broker -local -lp ssl:1666 -tp public.perforce.com:1666 -sdp_dir /opt/perforce/dev/sdp|0|/root/install_sdp/install_sdp.log|SUCCESS:|Live Run - Broker Install. LocalBrokerInstall|su - perforce -c '/p4/common/bin/verify_sdp.sh -skip p4t_files'|0|/p4/1/logs/verify_sdp.log|ALL CLEAN:|SDP verify check. LocalBrokerInstall|stat -c %U /p4/common|0|output|perforce|Check that 'chown -h' delivers POSIX-compliant results. Owner should be 'perforce', not 'root'. The first release of Ubuntu 26.04 fails this test. #------------------------------------------------------------------------------ # Special: Battle School Workshop Reset # # Note that these BSW* "tests" are skipped when using the 'r' wrapper without # specifying a TestGroup, since these are not part of the SDP regression test # suite. Rather than being tests, these use the test suite harness (which # contains DANGER_CLEAN.sh and similar scripts useful for BSW lab resets) to # the lab environment between labs. # # These are intended to be called by other automation, not directly called # by humans. The automation will call: # r BSW_Commit on the BSW commit server. # r BSW_OtherHosts on all other BSW P4 server machines. # BSW_Commit|/opt/perforce/.dev/bin/DANGER_CLEAN.sh -bsw -y|0|output||BSW Setup: Remove SDP and BSW dirs. BSW_Commit|mkdir -p /opt/perforce/p4-sdp/downloads|0|output||BSW Setup: Create /opt/perforce/p4-sdp for '-local' install. BSW_Commit|rsync -a --delete /opt/perforce/.dev/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||BSW Setup for '-local' install, populate p4_binaries. BSW_Commit|rsync -a --delete /opt/perforce/.dev/downloads/ /opt/perforce/p4-sdp/downloads|0|output||BSW Setup for '-local' install, populate downloads. BSW_Commit|rsync -a /opt/perforce/.dev/sdp/Server/Unix/setup/install_sdp.sh /root/sdp_install/install_sdp.sh|0|output||BSW Setup - Get latest install_sdp.sh BSW_Commit|cd /root/sdp_install && umask 0022 && ./install_sdp.sh -c sdp_install.${HOSTNAME%%.*}.cfg -y -local -keep_env -d -sampledepot -sdp_dir /opt/perforce/.dev/sdp -sdp_overlay_dir /usr/local/p4battleschool/sdp.overlay -no_ppr -no_pkgs|0|/root/sdp_install/install_sdp.log|^SUCCESS:|BSW Reset: install_sdp is done. BSW_OtherHosts|/opt/perforce/.dev/bin/DANGER_CLEAN.sh -bsw -y|0|output||BSW Setup: Remove SDP and BSW dirs. BSW_OtherHosts|mkdir -p /opt/perforce/p4-sdp/downloads|0|output||BSW Setup: Create /opt/perforce/p4-sdp for '-local' install. BSW_OtherHosts|rsync -a --delete /opt/perforce/.dev/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||BSW Setup for '-local' install, populate p4_binaries. BSW_OtherHosts|rsync -a --delete /opt/perforce/.dev/downloads/ /opt/perforce/p4-sdp/downloads|0|output||BSW Setup for '-local' install, populate downloads. BSW_OtherHosts|rsync -a /opt/perforce/.dev/sdp/Server/Unix/setup/install_sdp.sh /root/sdp_install/install_sdp.sh|0|output||BSW Setup - Get latest install_sdp.sh BSW_OtherHosts|cd /root/sdp_install && umask 0022 && ./install_sdp.sh -c sdp_install.${HOSTNAME%%.*}.cfg -y -local -keep_env -d -empty -sdp_dir /opt/perforce/.dev/sdp -sdp_overlay_dir /usr/local/p4battleschool/sdp.overlay -no_ppr -no_pkgs|0|/root/sdp_install/install_sdp.log|^SUCCESS:|BSW Reset: install_sdp is done. # EFS Secondary servers (bos-02 shares EFS with bos-01; syd-05 shares EFS with syd-04) # use this group instead of BSW_OtherHosts. Skips DANGER_CLEAN (which would wipe # EFS-shared depot content) and uses install_sdp.sh -ued (use existing data) to # preserve EFS contents while refreshing SDP scripts and binaries. BSW_EFSSecondary|mkdir -p /opt/perforce/p4-sdp/downloads|0|output||BSW EFS Secondary: Create /opt/perforce/p4-sdp for -local install. BSW_EFSSecondary|rsync -a --delete /opt/perforce/.dev/p4_binaries/ /opt/perforce/p4-sdp/p4_binaries|0|output||BSW EFS Secondary: populate p4_binaries. BSW_EFSSecondary|rsync -a --delete /opt/perforce/.dev/downloads/ /opt/perforce/p4-sdp/downloads|0|output||BSW EFS Secondary: populate downloads. BSW_EFSSecondary|rsync -a /opt/perforce/.dev/sdp/Server/Unix/setup/install_sdp.sh /root/sdp_install/install_sdp.sh|0|output||BSW EFS Secondary: Get latest install_sdp.sh BSW_EFSSecondary|rm -f /root/sdp_install/install_sdp.log|0|output||BSW EFS Secondary: Remove stale install_sdp.log symlink. BSW_EFSSecondary|rm -rf /opt/perforce/p4-sdp/p4|0|output||BSW EFS Secondary: Remove stale p4-sdp/p4 dir so install_sdp.sh can recreate it. BSW_EFSSecondary|cd /root/sdp_install && umask 0022 && ./install_sdp.sh -c sdp_install.${HOSTNAME%%.*}.efs.cfg -y -local -keep_env -d -ued -sdp_dir /opt/perforce/.dev/sdp -sdp_overlay_dir /usr/local/p4battleschool/sdp.overlay -no_ppr -no_pkgs|0|/root/sdp_install/install_sdp.log|^SUCCESS:|BSW EFS Secondary Reset: install_sdp done.