Beispiel #1
0
    def setUp(self):
        self.sandbox_path = tempfile.mkdtemp(prefix="jens_sandbox_%s-" %
                                             self._testMethodName,
                                             suffix='-' + str(time.time()))
        init_sandbox(self.sandbox_path)
        self.keep_sandbox = False
        self.debug_level = JensTestCase.DEFAULT_DEBUG_LEVEL
        self.config_file_path = "%s/etc/main.conf" % self.sandbox_path
        config_file = open(self.config_file_path, 'w+')
        config_file.write(
            BASE_CONFIG.substitute(sandbox=self.sandbox_path,
                                   hashprefix=JensTestCase.COMMIT_PREFIX,
                                   debuglevel=self.debug_level,
                                   mandatory_branches=','.join(
                                       JensTestCase.MANDATORY_BRANCHES)))
        config_file.close()

        root = logging.getLogger()
        map(root.removeHandler, root.handlers[:])
        map(root.removeFilter, root.filters[:])

        self.settings = Settings("jens-test")
        self.settings.parse_config(self.config_file_path)

        self.lock = JensLockFactory.makeLock(self.settings)
Beispiel #2
0
    def setUp(self):
        self.sandbox_path = tempfile.mkdtemp(
            prefix="jens_sandbox_%s-" % self._testMethodName,
            suffix='-' + str(time.time()))
        init_sandbox(self.sandbox_path)
        self.keep_sandbox = bool(os.getenv('JENS_TEST_KEEP_SANDBOX', False))
        self.debug_level = JensTestCase.DEFAULT_DEBUG_LEVEL
        self.config_file_path = "%s/etc/main.conf" % self.sandbox_path
        config_file = open(self.config_file_path, 'w+')
        config_file.write(BASE_CONFIG.substitute(
            sandbox=self.sandbox_path,
            hashprefix=JensTestCase.COMMIT_PREFIX,
            debuglevel=self.debug_level,
            mandatory_branches=','.join(JensTestCase.MANDATORY_BRANCHES)))
        config_file.close()

        root = logging.getLogger()
        for handler in root.handlers[:]:
            root.removeHandler(handler)
        for _filter in root.filters[:]:
            root.removeFilter(_filter)

        self.settings = Settings("jens-test")
        self.settings.parse_config(self.config_file_path)

        self.lock = JensLockFactory.make_lock(self.settings)
Beispiel #3
0
    def setUp(self):
        super(UpdateTest, self).setUp()

        ensure_environment(self.settings, 'production', 'master')
        ensure_environment(self.settings, 'qa', 'qa')

        init_repositories(self.settings)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'site', bare)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'hieradata', bare)

        self.lock = JensLockFactory.makeLock(self.settings)
Beispiel #4
0
    def setUp(self):
        super(UpdateTest, self).setUp()

        ensure_environment(self.settings, 'production', 'master')
        ensure_environment(self.settings, 'qa', 'qa')

        init_repositories(self.settings)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'site', bare)
        (bare, user) = create_fake_repository(self.settings, self.sandbox_path, ['qa'])
        add_repository(self.settings, 'common', 'hieradata', bare)

        self.lock = JensLockFactory.makeLock(self.settings)