def run_tests(self): ''' run a set of tests. ''' url = self.url.get() if self.login.get() is 1: cookie = test_occi.get_session_cookie(self.url.get(), self.user.get(), self.password.get()) heads = {'Cookie': cookie} else: heads = {} # display basic information self.info_text.configure(text = 'Server version:\n' + test_occi.get_version(url, heads) + '\nNumber of registered categories:\n' + str(len(test_occi.get_categories(url, heads))), anchor = W, justify = LEFT) # run the tests... self.run_single_test(test_occi.test_version_information, url, heads, self.version_test_label) self.run_single_test(test_occi.test_infrastructure_model_for_completness, url, heads, self.infra_model_test_label) self.run_single_test(test_occi.test_accept_header, url, heads, self.accept_header_test_label) self.run_single_test(test_occi.test_create_kinds, url, heads, self.creational_test_label) self.run_single_test(test_occi.test_mixins, url, heads, self.mixin_test_label) self.run_single_test(test_occi.test_links, url, heads, self.link_test_label) self.run_single_test(test_occi.test_actions, url, heads, self.action_test_label) self.run_single_test(test_occi.test_filter, url, heads, self.filter_test_label) self.run_single_test(test_occi.test_location, url, heads, self.location_path_label) self.run_single_test(test_occi.test_syntax, url, heads, self.syntax_test_label)
def __init__(self, url, username = None, password = None): if username is not None and password is not None: heads = cookie = test_occi.get_session_cookie(url, username, password) heads = {'Cookie': cookie} else: heads = {} print('Examining OCCI service at URL: ' + url) print('\n') print('NOTE: Passing all tests only indicates that the service') print('you are testing is OCCI compliant - IT DOES NOT GUARANTE IT!') print('\n') print('Version string the service reported: ' + test_occi.get_version(url, heads)) print('Number of registered categories: ' + str(len(test_occi.get_categories(url, heads)))) print('\n') self.run_tests(url, heads)