WebVM

Web runtime client tests

Caveat: Install paths MUST be absolute.

widget runtime

Connect to the simulator with telnet localhost 1201.

Note the root of simulator can be accessed by the host at /scratchbox/users/$(whoami)/targets/coronado-simulator.

id summary comment
2 install a widget
3 discover path of installed widget
4 list installed widgets
5 run a widget
6 stop a widget
7 validate widget
8 show widget configuration

Signature processing

How to install a test root certificate

The test root certificate is installed automatically after installing the Aplix Web runtime (WRT) deliverables. The test widget is http://test.webvm.net/WebCommander.wgt

Check to see subject attributes are correct (-s argument)

$ wget -q http://test.webvm.net/WebCommander.wgt
$ wrtc -i webc $(pwd)/WebCommander.wgt
$ wrtc -s 56297a7bc43277bff1dc5c8501e782c8fe014f23
author-key-root-cn: test.webvm.net
author-key-root-dn: /C=GB/ST=Surrey/L=Guildford/CN=test.webvm.net
author-key-fingerprint: C49AA310892A6E4E940A07B4EA24F0DC6B56E97B
author-key-cn: test.webvm.net
author-key-dn: /C=GB/ST=Surrey/L=Guildford/CN=test.webvm.net
distributor-key-root-cn: test.webvm.net
distributor-key-root-dn: /C=GB/ST=Surrey/L=Guildford/CN=test.webvm.net
distributor-key-fingerprint: C49AA310892A6E4E940A07B4EA24F0DC6B56E97B
distributor-key-cn: test.webvm.net
distributor-key-dn: /C=GB/ST=Surrey/L=Guildford/CN=test.webvm.net

Un-install, make a trivial change in the config.xml so that the signature becomes invalid. Try install it again and ensure the widget is rejected.

Your ~/.vimrc should have au BufReadCmd *.wgt call zip#Browse(expand("<amatch>")) in order to edit a widget, like so:

cd /scratchbox/users/$(whoami)/targets/coronado-simulator
cp WebCommander.wgt hacked.wgt
vim hacked.wgt

Make a trivial change to config.xml of hacked.wgt.

Or download from http://wiki.webvm.net/wrtc/hacked.wgt

$ wrtc -i webc $(pwd)/hacked.wgt

Test passes if widget fails to install.

Replace WRT root certificate with bad certificate and verify install fails

Download an invalid (expired) root certificate:

wget "http://git.webvm.net/?p=wgtqa;a=blob_plain;f=xmldsig/example-rsa-keys/example.pub;hb=94a9d911c7dee9e90faf64f26f4e9c3d26271b11" -O /scratchbox/users/$(whoami)/targets/coronado-simulator/bad.pub

Test passes when a correctly signed widget fails to install on a WRT configured with a bad certificate.

Example output:

root@simulator:/# cp /opt/etc/widget-certs/example.pub good.pub
root@simulator:/# cp bad.pub /opt/etc/widget-certs/example.pub
root@simulator:/# wrtc -i webc $(pwd)/WebCommander.wgt
error: invalid distributor signature: //WebCommander.wgt could not be installed
root@simulator:/# cp good.pub /opt/etc/widget-certs/example.pub
root@simulator:/# wrtc -i webc $(pwd)/WebCommander.wgt
5f6ae3794e33acabab27d70770874dc710d23fb2