Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
shib-idp/tests/fulltest.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
79 lines (71 sloc)
2.13 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd test-compose &>/dev/null | |
echo "Launching fresh containers..." | |
./decompose.sh -y &>/dev/null | |
./compose.sh &>/dev/null | |
popd &>/dev/null | |
echo "Waiting 4 minutes while everything comes up..." | |
sleep 240 | |
pushd tests &>/dev/null | |
rm -f ./lastpage.txt | |
#ensure webisoget is installed | |
echo "ensuring that webisoget is installed..." | |
rpm -q webisoget &>/dev/null | |
if [ $? -ne '0' ]; then | |
echo "downloading webisoget rpm" | |
curl -s -L -o webisoget-2.8.7-1.x86_64.rpm https://github.internet2.edu/docker/util/blob/master/bin/webisoget-2.8.7-1.x86_64.rpm?raw=true | |
if [ -s webisoget-2.8.7-1.x86_64.rpm ]; then | |
echo "installing rpm..." | |
sudo rpm -ivh webisoget-2.8.7-1.x86_64.rpm | |
rm -f webisoget-2.8.7-1.x86_64.rpm | |
else | |
echo "can't get webisoget rpm..." | |
exit 1 | |
fi | |
else | |
echo "webisoget already installed..." | |
fi | |
#ensure that name resolution is in place | |
ping -c 1 sptest.example.edu &>/dev/null | |
if [ $? -ne '0' ]; then | |
echo "adding hosts record for sp..." | |
echo '127.0.0.1 sptest.example.edu' | sudo tee -a /etc/hosts | |
fi | |
ping -c 1 idp.example.edu &>/dev/null | |
if [ $? -ne '0' ]; then | |
echo "adding hosts record for idp..." | |
echo '127.0.0.1 idp.example.edu' | sudo tee -a /etc/hosts | |
fi | |
echo "Attempting full-cycle test..." | |
webisoget -verbose -out ./lastpage.txt -formfile ./sptest.login -url https://sptest.example.edu:8443/secure/index.php | |
if [ -s ./lastpage.txt ]; then | |
cat lastpage.txt | grep kwhite@example.edu &>/dev/null | |
if [ $? == "0" ]; then | |
echo "The full-cycle test of the IdP and SP was successfull!" | |
echo "" | |
pushd ../test-compose &>/dev/null | |
./decompose.sh -y &>/dev/null | |
popd &>/dev/null | |
rm -f lastpage.txt | |
popd &>/dev/null | |
exit 0 | |
else | |
echo "The full-cycle test of the IdP and SP failed." | |
echo "" | |
pushd ../test-compose &>/dev/null | |
./decompose.sh -y &>/dev/null | |
popd &>/dev/null | |
rm -f lastpage.txt | |
popd &>/dev/null | |
exit 1 | |
fi | |
else | |
echo "The full-cycle test of the IdP and SP failed (no output)." | |
echo "" | |
pushd ../test-compose &>/dev/null | |
./decompose.sh -y &>/dev/null | |
popd &>/dev/null | |
rm -f lastpage.txt | |
popd &>/dev/null | |
exit 1 | |
fi | |