Skip to content

leap_cli tests should be able to run alone

"Webapp/Can_authenticate?" and "Webapp/Can_delete_user?" are dependend on "Webapp/Can_create_user?" and cannot be run standalone:

root@pixelated:/home/leap/leap_platform# ./bin/run_tests --list-tests
Network/Can_connect_to_internet?
Network/Is_stunnel_running?
Network/Is_shorewall_running?
Mx/Can_contact_couchdb?
Mx/Can_contact_couchdb_via_haproxy?
Mx/Are_MX_daemons_running?
CouchDB/Are_daemons_running?
CouchDB/Is_CouchDB_running?
CouchDB/Is_cluster_membership_ok?
CouchDB/Are_configured_nodes_online?
CouchDB/Do_ACL_users_exist?
CouchDB/Do_required_databases_exist?
CouchDB/Can_records_be_created?
Soledad/Is_Soledad_running?
Webapp/Can_contact_couchdb?
Webapp/Can_contact_couchdb_via_haproxy?
Webapp/Are_daemons_running?
Webapp/Can_access_webapp?
Webapp/Can_create_user?
Webapp/Can_authenticate?
Webapp/Can_delete_user?


root@pixelated:/home/leap/leap_platform# ./bin/run_tests --test Webapp/Can_create_user?
PASS: Webapp > Can create user?
1 tests: 1 passes, 0 skips, 0 warnings, 0 failures, 0 errors

root@pixelated:/home/leap/leap_platform# ./bin/run_tests --test Webapp/Can_authenticate?
ERROR: Webapp > Can authenticate? [webapp.rb:59]:
  NameError: uninitialized class variable @@user in Webapp
  /home/leap/leap_platform/tests/white-box/webapp.rb:59:in `test_06_Can_authenticate?'
Tests halted on error (because of --no-continue).

root@pixelated:/home/leap/leap_platform# ./bin/run_tests --test Webapp/Can_delete_user?
ERROR: Webapp > Can delete user? [webapp.rb:85]:
  NameError: uninitialized class variable @@user_id in Webapp
  /home/leap/leap_platform/tests/white-box/webapp.rb:85:in `test_07_Can_delete_user?'
Tests halted on error (because of --no-continue).

i think they should be combined into one test so nagios can use it as well (and also contain a soledad sync test, see #6384 (closed)).

(from redmine: created on 2014-11-25, closed on 2014-11-26, relates #6384 (closed))