Wednesday, November 17, 2010

is it alive II

I need a hammer for pulling bundle state info as Sakai3 comes up:
. ~/.resty/resty
resty http://santoku.local:8080
for  namei in santoku_three_{1..20}
 echo "getting $namei at one second intervals"
 GET /system/console/bundles/.json -u admin:admin | pp > /tmp/lifecycle$namei &
 sleep 1
then I examined the files 'by hand' for differences. This black box approach is good enough to learn how the state changes. ( of course comments are welcome! )

So on my test box sakai3 comes up and is fully alive in about 12-odd seconds.

The bundle states go from Installed to Resolved to Active.

So testing scripts can start up once all the bundles are Active.

Starting in with the Ruby scripts found in testscripts/SlingRuby I follow the README.txt's instructions for updating my build of Ruby. To get the top-level "is your environment ready" scripts to run I have to modify them a bit. They didn't load the supplied ./lib utilities so I added

$LOAD_PATH << './lib'

This may be due to some kind of Rubistia envronment setting I'm missing. The "is your environment ready" scripts were testing localhost, which I'm not, so I modified the line that looks like it creates a new Sling bot:

@s ="http://santoku.local:8080/")

and blammo:
bash-3.2$ ./create-user.rb testuser
User: testuser (pass: testuser)

As the main body of the Ruby test scripts are run quite often I wonder what the heck is going on here. 

IRC trip to #sakai to ask whether or not this load path stumble I had is due to my environment missing some settings ruby practitioners commonly use. It looks like these little scripts were just left out of a large sweep which reworked issues like this for the main body of Ruby tests.

It would be better if the README.txt and the "is your environment ready" scripts just worked OOTB, esp as more newbs like me come on-line, but that's a little thing in the pace of the project. I'll file a JIRA for the library path problems.

These little scripts are enough for me to see how to plug in the "is it alive" bit. Onward!

No comments: