From 6b91058a774bad832ddd9f231cfbfb1f8882291a Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Thu, 13 Sep 2018 17:40:05 -0400 Subject: [PATCH] functional_tests: Test repro config backup and restore Signed-off-by: James Valleroy Reviewed-by: Joseph Nuthalapati --- functional_tests/features/repro.feature | 11 ++++++++++- functional_tests/step_definitions/site.py | 15 +++++++++++++++ functional_tests/support/site.py | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/functional_tests/features/repro.feature b/functional_tests/features/repro.feature index c2aca2cc2..a865c1986 100644 --- a/functional_tests/features/repro.feature +++ b/functional_tests/features/repro.feature @@ -15,7 +15,7 @@ # along with this program. If not, see . # -@apps @sip +@apps @sip @backups Feature: Repro SIP Server Make audio and video calls. @@ -32,3 +32,12 @@ Scenario: Disable repro application Given the repro application is enabled When I disable the repro application Then the repro service should not be running + +Scenario: Backup and restore repro + Given the repro application is enabled + And repro has been configured + When I create a backup of the repro app data + And I delete the repro configuration + And I export the repro app data backup + And I restore the repro app data backup + Then the repro configuration should be restored diff --git a/functional_tests/step_definitions/site.py b/functional_tests/step_definitions/site.py index dee199bea..5cbc25cad 100644 --- a/functional_tests/step_definitions/site.py +++ b/functional_tests/step_definitions/site.py @@ -96,3 +96,18 @@ def mediawiki_delete_main_page(browser): @then('the mediawiki main page should be restored') def mediawiki_verify_text(browser): assert site.mediawiki_has_main_page(browser) + + +@given('repro has been configured') +def repro_configure(browser): + site.repro_configure(browser) + + +@when('I delete the repro configuration') +def repro_delete_config(browser): + site.repro_delete_config(browser) + + +@then('the repro configuration should be restored') +def repro_is_configured(browser): + assert site.repro_is_configured(browser) diff --git a/functional_tests/support/site.py b/functional_tests/support/site.py index 022efa9db..962ff6aae 100644 --- a/functional_tests/support/site.py +++ b/functional_tests/support/site.py @@ -141,3 +141,24 @@ def mediawiki_has_main_page(browser): browser.visit('{}/mediawiki/Main_Page'.format(interface.default_url)) content = browser.find_by_id('mw-content-text').first return 'This page has been deleted.' not in content.text + + +def repro_configure(browser): + """Configure repro.""" + browser.visit( + '{}/repro/domains.html?domainUri=freedombox.local&domainTlsPort=' + '&action=Add'.format(interface.default_url)) + + +def repro_delete_config(browser): + """Delete the repro config.""" + browser.visit('{}/repro/domains.html?domainUri=&domainTlsPort=' + '&action=Remove&remove.freedombox.local=on'.format( + interface.default_url)) + + +def repro_is_configured(browser): + """Check whether repro is configured.""" + browser.visit('{}/repro/domains.html'.format(interface.default_url)) + remove = browser.find_by_name('remove.freedombox.local') + return bool(remove)