Showing posts with label opensso. Show all posts
Showing posts with label opensso. Show all posts

Tuesday, July 21, 2009

Building your own OpenSSO ? Heres how you can quickly test it

I guess not many members of the OpenSSO community are aware of the testing framework inbuilt in the product. This article will help you to understand how you can use this feature to quickly validate your OpenSSO build.

Where is the framework?
It is called qatest and in available under opensso, when you check out the cvs source code.

What is the framework?
It is a pure java based testing framework built using open source tools like testng,ant,jetty

Which aspect of the framework is covered in this article?
Sanity tests all the core features of OpenSSO product. Helps avoiding basic regressions.

How to use it?
What I am covering in this article, is how to quickly sanity test a opensso build.
There is some setup required, gathering all the required jars, as this is not shipped with the product. But the results are worth this effort.
Other than this, with minimalist changes required, you get all the key features of opensso tested.

Prerequisites
1) From Opensso - opensso.war, Deploy the war on a supported container. You dont have to configure it.
2) Ant version 1.7.1 or above
3) Gathering the required jars. Place the following jars /qatest/lib folder.
-- openssoclientsdk.jar,opensso-sharedlib.jar corresponding to the build you are testing
-- testng-5.10beta-jdk15.jar,mysql-connector-java-5.0.8-bin.jar,javaee.jar,jsse.jar,saaj-api.jar,saaj-impl.jar,servlet.jar,webservices-rt.jar
-- Create a folder
/qatest/lib/jetty and copy the jetty jars here
-- Create a folder /qatest/lib/htmlunit and copy the htmlunit1.1.4 jars here
-- Create a folder /qatest/lib/xacml and copy the jaxb-impl.jar jaxb-libs.jar
jars here
Click below for a diagrammatic representation of all the lib


4) Go to
/qatest/resources
5) Copy the file Configurator-server_name.properties.template, and create a .properties file.
Eg: myserver.properties
6) Edit the file for details matching the setup you planned.
Eg:Below is my file,stripped of comments, which I used to run the sanity tests in my laptop.
com.iplanet.am.naming.url=http://localhost:8080/opensso/namingservice
cookiedomain=
amadmin_password=secret12
com.iplanet.am.service.password=secret123
config_dir=/Users/nithyasrinivasan/opensso-localhost
directory_server=localhost
directory_port=50389
config_root_suffix=dc=opensso,dc=java,dc=net
ds_dirmgrpasswd=secret12

Now what?
You are done.
Goto
/qatest, fire the tests.

ant -lib lib/ant-contrib-1.0b3.jar -DSERVER_NAME1=myserver run

If the tests have been executed successfully, the run should finish the following output
[echo] The Automation reports are at <
opensso home dir>/qatest//ldapv3/sanity

You can see the reports at this location.

Sample reports -

Wednesday, July 15, 2009

Opensso configuration failure - Not enough space on opends logs

Symptom:
------------
Checking configuration directory /export/qatest/TOMCAT/opensso-18080....Success.
Installing OpenSSO configuration store...Success RSA/ECB/OAEPWithSHA1AndMGF1Padding.
Configuration failed!
/opends/logs/errors
[16/Jul/2009:13:30:46 -0700] category=JEB severity=NOTICE msgID=8847402 msg=The database backend userRoot containing 0 entries has started
[16/Jul/2009:13:30:50 -0700] category=CONFIG severity=SEVERE_ERROR msgID=3407988 msg=An error occurred while trying to initialize a backend loaded from class org.opends.server.backends.TrustStoreBackend with the information in configuration entry ds-cfg-backend-id=ads-truststore,cn=Backends,cn=config: Error while attempting to generate a self-signed certificate ads-certificate in the trust store file config/ads-truststore: KeyStoreException(Cannot run program "/usr/dist/share/java,v1.6.0_05/5.x-i86pc/jre/bin/keytool": error=12, Not enough space) (TrustStoreBackend.java:1897 TrustStoreBackend.java:359 BackendConfigManager.java:1298 BackendConfigManager.java:279 DirectoryServer.java:2555 DirectoryServer.java:1358 EmbeddedUtils.java:89 EmbeddedOpenDS.java:264 EmbeddedOpenDS.java:199 AMSetupServlet.java:559 AMSetupServlet.java:615 AMSetupServlet.java:691 AMSetupServlet.java:398 AMSetupServlet.java:342 HttpServlet.java:637 HttpServlet.java:717 ApplicationFilterChain.java:290 ApplicationFilterChain.java:206 AMSetupFilter.java:99 ApplicationFilterChain.java:235 ApplicationFilterChain.java:206 ...). This backend will be disabled


Resolution:
-------------
-->Check /tmp and swap space
--> Also use a local java so that the tmp dir is set to local /tmp
--> Check if there are any hanging processed for the containers. In one instance, since the servers are configured using scripts, there were few orphan processes consuming all the memory