Recreate test suite
This commit is contained in:
parent
1bcd3f79ed
commit
0a864ea826
40 changed files with 788 additions and 1184 deletions
BIN
deploy-javaee-war/javaee.war
Normal file
BIN
deploy-javaee-war/javaee.war
Normal file
Binary file not shown.
4
deploy-javaee-war/main.fmf
Normal file
4
deploy-javaee-war/main.fmf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
summary: Tomcat deploy Javaee war test. Checks our migration tool works as expected.
|
||||
description: Start Tomcat as a service. Check it deploys successfully the javaee war by making a call to /hello path. Stop Tomcat.
|
||||
require+:
|
||||
- curl
|
||||
39
deploy-javaee-war/test.sh
Executable file
39
deploy-javaee-war/test.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
CATALINA_BASE=/var/lib/tomcat
|
||||
|
||||
rlJournalStart
|
||||
|
||||
rlPhaseStartSetup "Pre-Test Environment Setup"
|
||||
rlRun "cp javaee.war ${CATALINA_BASE}/webapps-javaee" 0 "Copying sample webapp"
|
||||
rlLog "Starting Tomcat service"
|
||||
rlServiceStart tomcat
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Verify Tomcat Service Functionality"
|
||||
# Wait until Tomcat is ready on localhost:8080
|
||||
rlLog "Waiting for Tomcat to become responsive on port 8080"
|
||||
for i in {1..10}; do
|
||||
if curl -s http://localhost:8080/ >/dev/null; then
|
||||
rlLog "Tomcat is up after ${i} seconds"
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
rlLog "Checking that javaee webapp exists"
|
||||
rlAssertExists ${CATALINA_BASE}/webapps/javaee
|
||||
rlRun "curl http://localhost:8080/javaee/hello | grep '<h1>Hello, World! This is a Javaee Servlet!'" 0 "Sample servlet"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup "Post-Test Teardown"
|
||||
rlLog "Stopping Tomcat service"
|
||||
rlServiceStop tomcat
|
||||
rlPhaseEnd
|
||||
|
||||
|
||||
rlJournalEnd
|
||||
rlJournalPrintText
|
||||
Loading…
Add table
Add a link
Reference in a new issue