Пример #1
0
    def setUp(self):
        self.config = load_configuration()
        self.project_name = "test_project_a"
        self.ida_project = "sudo -u %s %s/admin/ida_project" % (
            self.config["HTTPD_USER"], self.config["ROOT"])
        self.ida_user = "******" % (
            self.config["HTTPD_USER"], self.config["ROOT"])
        self.offlineSentinelFile = "%s/control/OFFLINE" % self.config.get(
            'STORAGE_OC_DATA_ROOT', '/mnt/storage_vol01/ida')

        # clear any residual accounts, if they exist from a prior run
        self.success = True
        noflush = self.config.get('NO_FLUSH_AFTER_TESTS', 'false')
        self.config['NO_FLUSH_AFTER_TESTS'] = 'false'
        self.tearDown()
        self.success = False
        self.config['NO_FLUSH_AFTER_TESTS'] = noflush

        print("(initializing)")

        # create project if it doesn't already exist
        cmd = "%s ADD %s 1 2>&1" % (self.ida_project, self.project_name)
        subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)

        # set quota to 1G, success tells us the project exists as required
        cmd = "%s MODIFY %s 1 2>&1" % (self.ida_project, self.project_name)
        OUT = subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)
        if OUT != 0:
            raise Exception("Failed to set up test project")
Пример #2
0
    def setUp(self):
        self.config = load_configuration()
        self.project_name = "test_project_a"
        self.ida_project = "sudo -u %s %s/admin/ida_project" % (
            self.config['HTTPD_USER'], self.config['ROOT'])
        self.ida_user = "******" % (
            self.config['HTTPD_USER'], self.config['ROOT'])

        # clear any residual accounts, if they exist from a prior run
        self.tearDown()

        print("(initializing)")
Пример #3
0
    def setUp(self):

        # load service configuration variables
        self.config = load_configuration()

        # keep track of success, for reference in tearDown
        self.success = False

        # timeout when waiting for actions to complete
        self.timeout = 10800 # 3 hours

        print("(initializing)")

        # ensure we start with a fresh setup of projects, user accounts, and data
        cmd = "sudo -u %s %s/tests/utils/initialize-test-accounts" % (self.config["HTTPD_USER"], self.config["ROOT"])
        result = os.system(cmd)
        self.assertEquals(result, 0)
Пример #4
0
    def setUp(self):
        self.config = load_configuration()
        self.project_name = "test_project_a"
        self.ida_project = "sudo -u %s %s/admin/ida_project" % (
            self.config["HTTPD_USER"], self.config["ROOT"])
        self.ida_user = "******" % (
            self.config["HTTPD_USER"], self.config["ROOT"])

        # clear any residual accounts, if they exist from a prior run
        self.tearDown()

        print("(initializing)")

        # create project if it doesn't already exist
        cmd = "%s ADD %s 1 2>&1" % (self.ida_project, self.project_name)
        subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)

        # set quota to 1G, success tells us the project exists as required
        cmd = "%s MODIFY %s 1 2>&1" % (self.ida_project, self.project_name)
        OUT = subprocess.call(cmd, shell=True, stdout=subprocess.PIPE)
        if OUT != 0:
            raise Exception("Failed to set up test project")