From 4fdcb4f126b36170c290f4059a8b019b8de5c9eb Mon Sep 17 00:00:00 2001 From: Christoph Kluenter Date: Tue, 1 Dec 2015 14:56:24 +0100 Subject: Revert "Disable webapp usercreation and soledad sync test" This reverts commit 58c4e6878561dc9772070e3ca9b666b9e1abdc7a. The test was fine. The assert_tmp_user was testing the database without using credentials. will be fixed in next commit --- tests/white-box/webapp.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/white-box/webapp.rb b/tests/white-box/webapp.rb index 48507521..e689c143 100644 --- a/tests/white-box/webapp.rb +++ b/tests/white-box/webapp.rb @@ -41,6 +41,35 @@ class Webapp < LeapTest pass end + def test_05_Can_create_and_authenticate_and_delete_user_via_API? + if property('webapp.allow_registration') + assert_tmp_user + pass + else + skip "New user registrations are disabled." + end + end + + def test_06_Can_sync_Soledad? + return unless property('webapp.allow_registration') + soledad_config = property('definition_files.soledad_service') + if soledad_config && !soledad_config.empty? + soledad_server = pick_soledad_server(soledad_config) + if soledad_server + assert_tmp_user do |user| + command = File.expand_path "../../helpers/soledad_sync.py", __FILE__ + soledad_url = "https://#{soledad_server}/user-#{user.id}" + soledad_cert = "/usr/local/share/ca-certificates/leap_ca.crt" + assert_run "#{command} #{user.id} #{user.session_token} #{soledad_url} #{soledad_cert} #{user.password}" + assert_user_db_exists(user) + pass + end + end + else + skip 'No soledad service configuration' + end + end + private def url_options -- cgit v1.2.3 From d610405e585966406fd9813423e300a39ef300b5 Mon Sep 17 00:00:00 2001 From: Christoph Kluenter Date: Tue, 1 Dec 2015 15:02:02 +0100 Subject: don't check in database if user was deleted. we already check if the webapp returned success when it deleted the user. If the webapp had failed it would not have returned success. leap_web has tests that prove this. This fixes https://leap.se/code/issues/7625 --- tests/helpers/bonafide_helper.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/helpers/bonafide_helper.rb b/tests/helpers/bonafide_helper.rb index 82db3973..20c3ca8d 100644 --- a/tests/helpers/bonafide_helper.rb +++ b/tests/helpers/bonafide_helper.rb @@ -98,14 +98,6 @@ class LeapTest assert(response = JSON.parse(body), 'Delete response should be JSON') assert(response["success"], 'Deleting user should be a success') end - domain = property('domain.full_suffix') - identities_url = couchdb_url("/identities/_design/Identity/_view/by_address?key=%22#{user.username}@#{domain}%22") - get(identities_url) do |body, response, error| - assert error.nil?, "Error checking identities db: #{error}" - assert response.code.to_i == 200, "Unable to check that user identity was deleted: HTTP response from API should have code 200, was #{response.code} #{error} #{body}" - assert(response = JSON.parse(body), 'Couch response should be JSON') - assert response['rows'].empty?, "Identity should have been deleted for test user #{user.username} (id #{user.id}), but was not! Response was: #{body}." - end end end -- cgit v1.2.3