Esempio n. 1
0
 def test_modify_service(self, opereto_client):
     self.opereto_client = opereto_client
     test_helpers.zip_and_upload (opereto_client,
                                  os.path.abspath ('test_data/microservices/testing_hello_world'),
                                  service_id=GENERIC_SERVICE_ID, mode='production', service_version='111')
     self.installed_microservices.append (GENERIC_SERVICE_ID)
     service = opereto_client.modify_service (GENERIC_SERVICE_ID, 'container')
     assert service['type'] == 'container'
Esempio n. 2
0
 def test_list_sandbox_services(self, opereto_client):
     self.opereto_client = opereto_client
     test_helpers.zip_and_upload (opereto_client,
                                  os.path.abspath ('test_data/microservices/testing_hello_world'),
                                  service_id='testing_hello_world', mode='development', service_version='111')
     assert 'testing_hello_world' in opereto_client.list_development_sandbox ()
     opereto_client.delete_service ('testing_hello_world')
     assert 'testing_hello_world' not in opereto_client.list_development_sandbox ()
Esempio n. 3
0
 def test_purge_development_sandbox(self, opereto_client):
     self.opereto_client = opereto_client
     test_helpers.zip_and_upload (opereto_client,
                                  os.path.abspath ('test_data/microservices/testing_hello_world'),
                                  service_id='testing_hello_world', mode='development', service_version='111')
     self.installed_microservices.append('testing_hello_world')
     assert 'testing_hello_world' in opereto_client.list_development_sandbox ()
     opereto_client.purge_development_sandbox ()
     assert 'testing_hello_world' not in opereto_client.list_development_sandbox ()
Esempio n. 4
0
 def test_delete_service_version(self, opereto_client):
     self.opereto_client = opereto_client
     test_helpers.zip_and_upload (opereto_client,
                                  os.path.abspath ('test_data/microservices/testing_hello_world'),
                                  service_id=GENERIC_SERVICE_ID, mode='production', service_version='111')
     assert '111' in opereto_client.get_service ('testing_hello_world')['versions']
     opereto_client.delete_service_version (service_id='testing_hello_world', mode='production',
                                            service_version='111')
     assert '111' not in opereto_client.get_service ('testing_hello_world')['versions']
Esempio n. 5
0
    def test_search_services(self, opereto_client):
        self.opereto_client = opereto_client
        test_helpers.zip_and_upload (opereto_client,
                                     os.path.abspath ('test_data/microservices/testing_hello_world'),
                                     service_id='testing_hello_world', mode='production', service_version='111')

        search_filter = {'generic': 'testing_hello_world'}
        search_result = opereto_client.search_services (filter=search_filter)
        assert search_result is not None
        opereto_client.delete_service ('testing_hello_world')
        search_result = opereto_client.search_services (filter=search_filter)
        assert search_result is None
Esempio n. 6
0
    def test_rerun_process(self, opereto_client):
        self.opereto_client = opereto_client
        test_helpers.zip_and_upload (opereto_client,
                                     os.path.abspath ('test_data/microservices/testing_hello_world'),
                                     service_id='testing_hello_world', mode='production',
                                     service_version='default')
        self.installed_microservices.append('testing_hello_world')
        process_properties = {"my_input_param": "Hello World"}

        pid = opereto_client.create_process (service='qwe', title='Testing...',
                                             agent=opereto_client.input['opereto_agent'], **process_properties)
        assert pid is not None
        opereto_client.wait_for ([pid])
        pid = opereto_client.rerun_process(pid)
        assert pid is not None
Esempio n. 7
0
    def test_search_process_logs(self, opereto_client):
        self.opereto_client = opereto_client
        test_helpers.zip_and_upload (opereto_client,
                                     os.path.abspath ('test_data/microservices/testing_hello_world'),
                                     service_id='testing_hello_world', mode='production',
                                     service_version='default')
        self.installed_microservices.append ('testing_hello_world')
        process_properties = {"my_input_param": "Hello World"}
        pid = opereto_client.create_process (service='testing_hello_world', title='Testing test_search_process_logs',
                                             agent=opereto_client.input['opereto_agent'], **process_properties)

        opereto_client.wait_for ([pid])

        search_filter = {'generic': 'The input parameters passed*'}
        search_result = opereto_client.search_process_log (pid, filter=search_filter)
        assert search_result['list'] is not None
        assert search_result['total'] is 1
Esempio n. 8
0
    def test_modify_process_properties(self, opereto_client):
        self.opereto_client = opereto_client
        test_helpers.zip_and_upload (opereto_client,
                                     os.path.abspath ('test_data/microservices/testing_hello_world'),
                                     service_id='testing_hello_world', mode='production',
                                     service_version='default')
        self.installed_microservices.append('testing_hello_world')
        process_properties = {"my_input_param": "Hello World"}
        pid = opereto_client.create_process (service='qwe', title='Testing...',
                                             agent=opereto_client.input['opereto_agent'], **process_properties)
        assert pid is not None

        process_output_properties = {'my_output_param_2' : 'out param value'}
        opereto_client.modify_process_properties(process_output_properties, pid)
        opereto_client.wait_for([pid])
        process_output_property_value = opereto_client.get_process_property(pid, 'my_output_param_2')
        assert process_output_property_value == 'out param value'