You can find a brief description of how to test a patch manually
at: http://docs.jboss.org/process-guide/en/html/support.html.
-
Steps required for JBoss WebServices pre 1.2.0 patch (both against 4.0.4.GA, jdk1.4.2 and 4.0.4.GA-ejb3 profile, jdk1.5_07)
JDK1.4
Once a patch has been delivered, get the jar/sar from JIRA. ex:http://jira.jboss.com/jira/browse/JBWS-1028
Create a folder in your home directory for this test. I created ~/qa/webservice
Create a binaries folder ~/qa/webservice/binaries
Copy the jar/sar here. Snapshot:
Pjhadev03Binaries$ pwd /home/pjha/qa/webservice/binaries Pjhadev03Binaries$ ls jbossws14-client.jar jbossws14.sar jbossws-client.jar jbossws.sar Pjhadev03Binaries$//Note:jar/sar with 14 in their name are to be used with JDK 1.4 and other ones are for JDK1.5
Get the patch-script.tar.gz from /opt and put it under ~/qa/webservice
tar xzvf patch-script.tar.gz
rename the patch-script folder to the JIRA issue id, eg.JBWS-1028
Read the README.txt to get the details of contents under this directory
Delete run-tests from the build-all target as we need to do some stuff before running the test suite (due to client jars not being replaced outside the binaries)
Make sure your JAVA_HOME is set to JDK1.4
Run ant build-all -Dcompl.number=<JBOSS_RELEASE_NUMBER> eg. 4.0.4.GA
The build file gets the source of given release, builds the AS, replaces all the matching jar/sar in newly built server with that from binaries folder.
Copy the jar/sar from binaries to thirdparty directory. Since this patch was for web servcies, I had to copy to /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4.GA-src/thirdparty/jboss/jbossws14/lib
Go to testsuite folder under newly built JBoss AS.e.g. /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4.GA-src/testsuite and run the all test cases
./build.sh clean ./build.sh tests -Dnode0=10.64.8.228 -Dnode1=$MYTESTIP_1 -DudpGroup=238.14.15.16
It takes about two hours to run all the test cases.
It may fail while generating test reports with OutOfMemory error. Do the following export ANT_OPTS=-Xmx640m ant reports
See the test report summary under /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4.GA-src/testsuite/output/reports/text
Make a backup of text report under different directory
Some errors are known and most of them don't happen when running the test cases seperately. I ran into these errors:
DETAILS OF ERRORS Suite: org.jboss.test.cluster.test.DRMTestCase(Default-UDP) #########IGNORE THIS ERROR ##################### Test: testNonConflictingAddRemoveDeadlock Type: failure Exception: junit.framework.AssertionFailedError Message: Acquired thread 5 --------------------------------- Suite: org.jboss.test.jbossmq.test.UnackedUnitTestCase ####NOT WITH ONE TEST Test: testUnackedDurableTopic Type: failure Exception: junit.framework.AssertionFailedError Message: Topic should be full --------------------------------- Suite: org.jboss.test.pooled.test.SSLSocketsUnitTestCase ####NOT WITH ONE TEST Test: testClientCertSSLAccess Type: error Exception: java.rmi.AccessException Message: SecurityException; nested exception is: javax.security.auth.login.FailedLoginException: Supplied Credential did not match existing credential for null Suite: org.jboss.test.webservice.samples.ServerSideJMSTestCase ####NOT WITH ONE TEST Test: testSOAPMessageToEndpointQueue Type: failure Exception: junit.framework.ComparisonFailure Message: expected:<<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:getContactI nfoResponse xmlns:ns1='http://org.jboss.test.webservice/samples'><result>The 'mafia' boss is currently out of office, please call again.</result></ns1:getContactInfoResponse></env:Body></env:Envelope>> but was:<null>
To verify that these errors dont occur when run individually, run the server with "all" config: /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4.GA-src/build/output/jboss-4.0.4.GA/bin/run.sh -c all -b $MYTEStIP_1 -u 238.1.2.17
From another console, run the failed test cases /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4.GA-src/testsuite/build.sh -Dtest=org.jboss.test.jbossmq.test.UnackedUnitTestCase one-test Note: All tests should pass
This verifies that the patch works with JDK1.4. If you see other errors then it means patch needs to repatched. Assign the JIRA issue back to
developer.
NOW verify that it works with JDK 1.5
Get the latest JBoss release version from sourceforge
-wget http://superb-west.dl.sourceforge.net/sourceforge/jboss/jboss-4.0.4.GA-Patch1-installer.jar or other mirrors to /home/pjha/qa/webservice/JBWS-1028
run java -jar jboss-4.0.4.GA-Patch1-installer.jar -installGroup ejb3 installpath=./jboss-4.0.4_installer
set java_home to jdk5
Rename the "default" server config to "all"
cd /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4_installer/server mv default all because test suites run under "all" configuration and "default" here is basically all.
Copy jdk5 jar/sar.
cp binaries/jbossws-client.jar /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4_installer/client/. cp binaries/jboss/jbossws.sar home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4_installer/server/all/deploy/
Copy these jdk15 jars to thirdparty as done for JDK14. /home/pjha/qa/webservice/JBWS-1028/jboss-4.0.4.GA-src/thirdparty/jboss/jbossws/lib. Note that it's jbossws/lib not jboss14/lib
Rename JBWS-1028/jboss-4.0.4.GA-src/build/output/jboss-4.0.4.GA to jboss-4.0.4.GA-temp
Move jboss-4.0.4_installer to JBWS-1028/jboss-4.0.4.GA-src/build/output/jboss-4.0.4.GA. Basically you are replacing the 4.0.4.GA build with the one from installer so that test can run against it.
Not all tests in testsuite will pass against jboss instance from installer. So, it's sufficient to pass "jboss-all-config-tests". It's better to confirm with developer in case patch specifically targets test under other test targets.
testsuite/build.sh clean testsuite/build.sh jboss-all-config-tests -Dnode0=10.64.8.228 -Dnode1=$MYTESTIP_1 -DudpGroup=238.14.15.16
Notes
If some cluster tests fail
You can run a single cluster testcase if you paste the contents of the following file ClusterTestTargets.ent in the testsuites build.xml. See below (from JBAS-3814):
From Brian Stansberry: I have attached an xml fragment "cluster-test-targets.ent" that can be pasted into the 4.0.3.SP1 testsuite/build.xml to give the ability to run a limited number of the clustering tests (the ones normall invoked from "tests-clustering". It adds 2 targets: one-cluster-test one-cluster-sync-test The first uses the "Default" config, the 2nd uses the "SyncModeNUseJVM" config. To use for running the ScopedTestCase that's in question here: build -Dtest=org/jboss/test/cluster/test/ScopedTestCase* one-cluster-sync-test
Steps required for JBoss WebServices 1.2.0+ patch
Few points:
First it seems JBoss internal testsuite (at least 4.0.5GA) cannot pass with these webservices versions.
Sample tests seem to be unable to compile with jdk14
Better bind to localhost
You could look at WebservicesReleaseGuide for hints
When running ws-internal and samples tests keep directory path short as classpath can get truncated and many tests fail!
for example use /home/username/a/jbossws instead of /home/username/JBWS-1222/checkout/jbossws-1.2.1GA
Generally for any tests we do:
compile (jbossws - laways jdk15, others - jdk we want to test)
deploy the GA WS version (use proper target for any jboss/jdk combination but using jdk15)
patch (see "Instructions on how to patch" below)
run tests
check if files stay patched after the testing (were not replaced somehow)
compare with non-patched results
Hence here is how did we tested last patches against JBoss AS 4.0.5GA ( See http://jira.jboss.com/jira/browse/JBWS-1768 a well):
setup environment
cd; mkdir a; cd a; svn export jbossws (patch branch); svn export jbossws-GA; svn export jbossas-4.0.5
assume $testdir is current dir, $jbossws is $testdir/jbossws, $jboss is $testdir/jboss
download binary versions of JBossAS 4.2GA, 5 BETA2 and tomcat 5
For every test assume you have this clean environment
JBoss AS 4.0.5GA, jdk15, ws-internal and samples
assume we always use jdk5
build jboss as
cd $jbossws-GA/build
edit ant.properties and set all non-hudson properties
as 4.0.5 server set the ejb3 directory
ant main && ant deploy-jboss40
cd $jbossws/build
edit ant.properties
ant main && ant jboss40-jars
replace all occurrences of patched files within jbossws and jboss dir
cd $testdir; mv jbossas-4.0.5/build/output/jboss...-ejb3 jboss (to make path short)
edit $jbossws/build/ant.properties with the new jboss home
start jbossas
cd $jbossws/jbossws-tests; ant main
check if all files are the patched versions
ant tests (all tests should pass)
cd $jbossws/build; ant build-samples (if you have troubles compiling, try '-Djavac.fail.onerror="false"' or downloading the precompiled samples package)
cd output/samples...; cp ../../ant.properties . ;ant main;
replace any patched files
ant tests (all should pass)
if some tests don't pass, try restarting the server and using the one-test target (e.g. ant one-test -Dtest=org.jboss.test.ws.jaxrpc.samples.wsbpel.hello.BpelHelloTestCase)
after finished testing check if all files in jbossws and jboss dir stay patched
JBoss AS 4.0.5GA, jdk14, ws-internal
use jdk 1.4.2 version with Bouncy Castle libraries installed!
as above with some exceptions
use deploy-jboss40-jdk14 instead of deploy-jboss40 and jboss40-jars14 instead of jboss40-jars
use jdk15 to build jbossws and deploy
use jdk14 to build jbossas, compile jbossws tests and run tests (set JAVA_HOME=/opt/j2sdk1.4.2_09-ws -this has bouncy castle security jar and ANT_HOME=/opt/apache-ant-1.6.5-ws -has updated xercesImpl and junit jar
use the non-ejb3 dir (there's no ejb3 one with jdk14)
skip samples (couldn't make them compile with jdk14)
JBoss AS 4.0.5GA internal tests (skip these as actually useless)
As there seem to be some incompatibilities we just compare results with patched and non-patched server
so compile jbossas (with the appropriate jdk)
edit jbossws ant.properties
set as jboss40 dir the ejb3 one if using jdk15
compile jbossws and deploy to all and default server instance (use proper deploy target for jdk 14 or 15 but always use jdk15)
run jboss testsuite and log to tests1.log (with proper jdk and use -Djboss.home to specify ejb3 directory)
replace patched files within the jbossas dir
run testssuite again and log to tests2.log
cat tests1.log | grep FAIL > t1.log
cat tests2.log | grep FAIL > t2.log
diff t1.log t2.log
if any regressions try one-test target
Patch testing of JBoss EAP:
note: we use only JDK 1.5 and ANT_HOME=/opt/apache-ant-1.6.5-ws (has updated xercesImpl and junit jar)
run the EAP test suite
that's pretty much like a regular patch testing
get proper release src zip
build from src
replace built JBoss AS with the noauth distro (or apply patch to the auth distro)
replace patched files
run tests suite (don't use localhost as one of the bind IPs and ensure correct mcast setup)
- note: if you run "./build.sh main" before tests, you need to specify -Dnode0/1 to have ws tests pass
run the WS test suite
unzip EAP version
unzip jboss 4.0.5
unzip jboss 5
checkout WS patch branch
edit jbossws/ant.properties or jbossws/build/ant.properties (ant.properties.example as sample)
integration target jboss42
server all (default have some services missing like juddi)
bind address (use the same string as the server's -b option)
- prefer shorter path depths
in jbossws or jbossws/build do "ant main && ant jboss42-jars" (or jars-jboss42)
NOTE: don't use deploy-jboss42 as you don't want to replace other files
in jbossws/jbossws-tests do "ant main" (WS 1.2.x only)
replace files in EAP directory and jbossws directory
export JAVA_OPTS="$JAVA_OPTS -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m" and start the server
"ant tests 2>&1 | tee test.log" in jbossws or jbossws/jbossws-tests dir
expect 100% pass rate
check patched files are not replaced
run WS sample tests
get apache tomcat 5.5 and edit ant.properties with its location (?)
cd jbossws or jbossws/build
ant tests-samples or see next steps if target doesn't exists (all should pass)
if not, try restarting the running server and run one-test
ant ... tests-samples -Dinclude.wildcard="org/jboss/test/ws/*/samples/**/<test name>.class"
See test-framework/ant-import/build-testsuite.xml for more details
if you get "java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console" and out of permgen in server log then also restart the server
(ws 1.2.x) ant build-samples -Djavac.fail.onerror="false" (the option is because compile fails with the beta jboss 5 zip) (?)
(ws 1.2.x) cd output/jbossws-samples-1.2.1.GA_CP01 && cp ../../ant.properties . && ant main && replace patched files && ant tests
check if patched files are still the same
Instructions on how to patch all files in a dir:
When you just need to replace files with ones with the same name:
Find command: "find -name <file1> -or -name <file2> ...
Check MD5SUM: "md5sum `<find command>`"
Replace all files in current dir and subdirs:
for i in `<find command>`; do nm=`basename $i` cp -v <binaries location>/$nm $i done
When you need to replace jbossws.sar in jboss-4.0.x:
you will need to replace expanded sars and non-expanded sar
as well file names are not the same
so no reliably working scripts are currently available
Comments