mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Test scripts have permission to run and fixes sshpass.
Updates vagrant file to have sshpass by default. Adds configuration for setting up the network in bridged mode so that the scripts can use mdns to connect to the roboRIO. Change-Id: I7274a24c772790c9495e8a1c083385ef528044a6
This commit is contained in:
0
test-scripts/config.sh
Normal file → Executable file
0
test-scripts/config.sh
Normal file → Executable file
5
test-scripts/deploy-and-run-test-on-robot.sh
Normal file → Executable file
5
test-scripts/deploy-and-run-test-on-robot.sh
Normal file → Executable file
@@ -65,9 +65,9 @@ TEST_RUN_ARGS="${@:2}"
|
||||
shopt -s huponexit
|
||||
|
||||
SCP_TEST_SCRIPT="scp config.sh ${DEFAULT_LOCAL_RUN_TEST_SCRIPT} ${ROBOT_ADDRESS}:/${DEFAULT_DESTINATION_DIR}"
|
||||
SSH_CHMOD_AND_MAKE_TEMP_TEST_DIR="ssh -t ${ROBOT_ADDRESS} 'chmod a+x ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT}; mkdir ${DEFAULT_TEST_SCP_DIR} 2>/dev/null'"
|
||||
SSH_CHMOD_AND_MAKE_TEMP_TEST_DIR="ssh -t ${ROBOT_ADDRESS} chmod a+x ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT}; mkdir ${DEFAULT_TEST_SCP_DIR} 2>/dev/null"
|
||||
SCP_TEST_PROGRAM="scp ${LOCAL_TEST_FILE} ${ROBOT_ADDRESS}:/${DESTINATION_TEST_FILE}"
|
||||
SSH_RUN_TESTS="ssh -t ${ROBOT_ADDRESS} '${DEFAULT_DESTINATION_RUN_TEST_SCRIPT} ${LANGUAGE} $(whoami) -d ${DEFAULT_TEST_SCP_DIR} ${TEST_RUN_ARGS}'"
|
||||
SSH_RUN_TESTS="ssh -t ${ROBOT_ADDRESS} ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT} ${LANGUAGE} $(whoami) -d ${DEFAULT_TEST_SCP_DIR} ${TEST_RUN_ARGS}"
|
||||
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SCP_TEST_SCRIPT}
|
||||
@@ -80,4 +80,3 @@ else
|
||||
eval ${SCP_TEST_PROGRAM}
|
||||
eval ${SSH_RUN_TESTS}
|
||||
fi
|
||||
|
||||
|
||||
6
test-scripts/jenkins-run-tests-get-results.sh
Normal file → Executable file
6
test-scripts/jenkins-run-tests-get-results.sh
Normal file → Executable file
@@ -18,7 +18,7 @@ fi
|
||||
mkdir ${DEFAULT_LOCAL_TEST_RESULTS_DIR} 2>/dev/null
|
||||
|
||||
# Remove the preivous test results from the the robot
|
||||
SSH_REMOVE_OLD_TEST_RESULTS="ssh -t ${ROBOT_ADDRESS} 'rm -R ${DEFAULT_DESTINATION_TEST_RESULTS_DIR}; mkdir ${DEFAULT_DESTINATION_TEST_RESULTS_DIR}'"
|
||||
SSH_REMOVE_OLD_TEST_RESULTS="ssh -t ${ROBOT_ADDRESS} rm -R ${DEFAULT_DESTINATION_TEST_RESULTS_DIR}; mkdir ${DEFAULT_DESTINATION_TEST_RESULTS_DIR}"
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SSH_REMOVE_OLD_TEST_RESULTS}
|
||||
else
|
||||
@@ -28,7 +28,7 @@ fi
|
||||
printf "Running cpp test\n"
|
||||
|
||||
# Run the C++ Tests
|
||||
deploy-and-run-test-on-robot.sh cpp "--gtest_output=xml:${DEFAULT_DESTINATION_CPP_TEST_RESULTS}"
|
||||
./deploy-and-run-test-on-robot.sh cpp "--gtest_output=xml:${DEFAULT_DESTINATION_CPP_TEST_RESULTS}"
|
||||
|
||||
# Retrive the C++ Test Results
|
||||
SCP_GET_CPP_TEST_RESULT="scp ${ROBOT_ADDRESS}:${DEFAULT_DESTINATION_CPP_TEST_RESULTS} ${DEFAULT_LOCAL_CPP_TEST_RESULT}"
|
||||
@@ -39,7 +39,7 @@ else
|
||||
fi
|
||||
|
||||
# Run the Java Tests
|
||||
deploy-and-run-test-on-robot.sh java
|
||||
./deploy-and-run-test-on-robot.sh java
|
||||
|
||||
# Retrive the Java Test Results
|
||||
SCP_GET_JAVA_TEST_RESULT="scp ${ROBOT_ADDRESS}:${DEFAULT_DESTINATION_JAVA_TEST_RESULTS} ${DEFAULT_LOCAL_JAVA_TEST_RESULT}"
|
||||
|
||||
0
test-scripts/run-tests-on-robot.sh
Normal file → Executable file
0
test-scripts/run-tests-on-robot.sh
Normal file → Executable file
21
test-scripts/spawn_driver_station.sh
Normal file → Executable file
21
test-scripts/spawn_driver_station.sh
Normal file → Executable file
@@ -21,16 +21,23 @@ fi
|
||||
echo $SSH_CHECK_FOR_TESTSTAND
|
||||
|
||||
if $(eval $SSH_CHECK_FOR_TESTSTAND); then
|
||||
echo "Driver STation is already running";
|
||||
echo "Driver Station is already running";
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
echo "Starting Driver Station";
|
||||
|
||||
SSH_START_TESTSTAND_DRIVER_STATION="ssh ${ROBOT_ADDRESS} '${TESTSTAND_SERVE_COMMAND}'"
|
||||
function startDS {
|
||||
SSH_START_TESTSTAND_DRIVER_STATION="ssh ${ROBOT_ADDRESS} ${TESTSTAND_SERVE_COMMAND}"
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SSH_START_TESTSTAND_DRIVER_STATION}
|
||||
else
|
||||
eval ${SSH_START_TESTSTAND_DRIVER_STATION}
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $(which sshpass) ]; then
|
||||
sshpass -p "" ${SSH_START_TESTSTAND_DRIVER_STATION} &
|
||||
else
|
||||
eval ${SSH_START_TESTSTAND_DRIVER_STATION} &
|
||||
fi
|
||||
startDS&
|
||||
|
||||
sleep 1
|
||||
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user