glare.tests.functional package¶
Submodules¶
glare.tests.functional.base module¶
-
class
glare.tests.functional.base.
TestArtifact
(*args, **kwargs)[source]¶ Bases:
glare.tests.functional.FunctionalTest
-
enabled_types
= (u’sample_artifact’, u’images’, u’heat_templates’, u’heat_environments’, u’tosca_templates’, u’murano_packages’, u’all’)¶
-
make_active
= [{‘path’: ‘/status’, ‘value’: ‘active’, ‘op’: ‘replace’}]¶
-
make_deactivated
= [{‘path’: ‘/status’, ‘value’: ‘deactivated’, ‘op’: ‘replace’}]¶
-
make_public
= [{‘path’: ‘/visibility’, ‘value’: ‘public’, ‘op’: ‘replace’}]¶
-
users
= {‘admin’: {‘tenant_id’: ‘a786aa9f-1ab7-455f-a2b8-e102ff858ae4’, ‘token’: ‘3b3981ab-d603-4d18-a7bf-21876b935cd9’, ‘role’: ‘admin’, ‘id’: ‘14eb4fd5-d187-4615-a2a5-a605d4ef73ff’}, ‘user2’: {‘tenant_id’: ‘a82ef57e-b197-4b53-8364-2e89ca1c934e’, ‘token’: ‘5973e121-9d01-43ab-a2ce-e9d5616e2c8f’, ‘role’: ‘member’, ‘id’: ‘ee279a88-4b64-48c2-b28e-3a876d1a2710’}, ‘anonymous’: {‘tenant_id’: None, ‘token’: None, ‘role’: None, ‘id’: None}, ‘user1’: {‘tenant_id’: ‘d040b07c-f02a-4f4c-a5b7-20b751845549’, ‘token’: ‘df1d0342-e70d-4460-a6fd-2aaa2a88a2e3’, ‘role’: ‘member’, ‘id’: ‘48e24def-c8a2-4e97-a5cd-f1cd9e8a40d8’}}¶
-
glare.tests.functional.test_all module¶
glare.tests.functional.test_database_store module¶
glare.tests.functional.test_quotas module¶
-
class
glare.tests.functional.test_quotas.
TestDynamicQuotas
(*args, **kwargs)[source]¶ Bases:
glare.tests.functional.base.TestArtifact
Test dynamic quota limits.
-
class
glare.tests.functional.test_quotas.
TestQuotasAPI
(*args, **kwargs)[source]¶ Bases:
glare.tests.functional.base.TestArtifact
Test quotas REST API.
glare.tests.functional.test_sample_artifact module¶
-
class
glare.tests.functional.test_sample_artifact.
TestTags
(*args, **kwargs)[source]¶ Bases:
glare.tests.functional.base.TestArtifact
glare.tests.functional.test_schemas module¶
glare.tests.functional.test_scrubber module¶
-
class
glare.tests.functional.test_scrubber.
TestScrubber
(*args, **kwargs)[source]¶ Bases:
glare.tests.functional.base.TestArtifact
Test that delayed_delete works and the scrubber deletes
-
test_scrubber_app
()[source]¶ Test that the scrubber script runs successfully when not in daemon mode.
-
glare.tests.functional.test_visibility module¶
-
class
glare.tests.functional.test_visibility.
TestVisibility
(*args, **kwargs)[source]¶ Bases:
glare.tests.functional.base.TestArtifact
Test Glare artifact visibility for various users.
Module contents¶
Base test class for running non-stubbed tests (functional tests)
The FunctionalTest class contains helper methods for starting Glare server, grabbing the logs of each, cleaning up pidfiles, and spinning down the server.
-
class
glare.tests.functional.
FunctionalTest
(*args, **kwargs)[source]¶ Bases:
glare.tests.utils.BaseTestCase
Base test class for any test that wants to test the actual servers and clients and not just the stubbed out interfaces
-
cleanup
()[source]¶ Makes sure anything we created or started up in the tests are destroyed or spun down
-
disabled
= False¶
-
inited
= False¶
-
launched_servers
= []¶
-
ping_server
(port)[source]¶ Simple ping on the port. If responsive, return True, else return False.
:note We use raw sockets, not ping here, since ping uses ICMP and has no concept of ports…
-
run_sql_cmd
(sql)[source]¶ Provides a crude mechanism to run manual SQL commands for backend DB verification within the functional tests. The raw result set is returned.
-
start_server
(server, expect_launch, expect_exit=True, expected_exitcode=0, **kwargs)[source]¶ Starts a server on an unused port.
Any kwargs passed to this method will override the configuration value in the conf file used in starting the server.
Parameters: - server – the server to launch
- expect_launch – true iff the server is expected to successfully start
- expect_exit – true iff the launched process is expected to exit in a timely fashion
- expected_exitcode – expected exitcode from the launcher
-
start_servers
(**kwargs)[source]¶ Starts the Glare server on unused port.
Any kwargs passed to this method will override the configuration value in the conf file used in starting the servers.
-
start_with_retry
(server, port_name, max_retries, expect_launch=True, **kwargs)[source]¶ Starts a server, with retries if the server launches but fails to start listening on the expected port.
Parameters: - server – the server to launch
- port_name – the name of the port attribute
- max_retries – the maximum number of attempts
- expect_launch – true iff the server is expected to successfully start
- expect_exit – true iff the launched process is expected to exit in a timely fashion
-
stop_server
(server)[source]¶ Called to stop a single server in a normal fashion.
Parameters: server – the server to stop
-
wait_for_servers
(servers, expect_launch=True, timeout=30)[source]¶ Tight loop, waiting for the given server port(s) to be available. Returns when all are pingable. There is a timeout on waiting for the servers to come up.
Parameters: - servers – Glare server ports to ping
- expect_launch – Optional, true iff the server(s) are expected to successfully start
- timeout – Optional, defaults to 30 seconds
Returns: None if launch expectation is met, otherwise an assertion message
-
-
class
glare.tests.functional.
GlareServer
(test_dir, port, policy_file, delayed_delete=False, pid_file=None, sock=None, **kwargs)[source]¶ Bases:
glare.tests.functional.Server
Server object that starts/stops/manages Glare server
-
class
glare.tests.functional.
ScrubberDaemon
(test_dir, policy_file, daemon=False, **kwargs)[source]¶ Bases:
glare.tests.functional.Server
Server object that starts/stops/manages the Scrubber server
-
class
glare.tests.functional.
Server
(test_dir, port, sock=None)[source]¶ Bases:
object
Class used to easily manage starting and stopping a server during functional test runs.
-
reload
(expect_exit=True, expected_exitcode=0, **kwargs)[source]¶ Start and stop the service to reload
Any kwargs passed to this method will override the configuration value in the conf file used in starting the servers.
-
-
class
glare.tests.functional.
TestRouter
(mapper)[source]¶ Bases:
glare.api.v1.router.API