Esempio n. 1
0
    def setUp(self):
        TempDirMixin.setUp(self)
        self.dir_orig = self.dir

        self.dir_master = pjoin(self.dir, 'master')
        self.dir_slave = pjoin(self.dir, 'slave')
        ensure_dirs(self.dir_master)
        ensure_dirs(self.dir_slave)

        ensure_dirs(pjoin(self.dir_master, 'metadata'))
        ensure_dirs(pjoin(self.dir_slave, 'metadata'))
        # silence missing masters warnings
        with open(pjoin(self.dir_master, 'metadata', 'layout.conf'), 'w') as f:
            f.write('masters =\n')
        with open(pjoin(self.dir_slave, 'metadata', 'layout.conf'), 'w') as f:
            f.write('masters = master\n')

        self.master_pdir = pjoin(self.dir_master, 'profiles')
        self.pdir = self.slave_pdir = pjoin(self.dir_slave, 'profiles')
        ensure_dirs(self.master_pdir)
        ensure_dirs(self.slave_pdir)
        # silence missing repo name warnings
        with open(pjoin(self.master_pdir, 'repo_name'), 'w') as f:
            f.write('master\n')
        with open(pjoin(self.slave_pdir, 'repo_name'), 'w') as f:
            f.write('slave\n')

        self.dir = self.dir_slave
Esempio n. 2
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.subdir = pjoin(self.dir, 'dir')
     os.mkdir(self.subdir)
     f = open(pjoin(self.dir, 'file'), 'w')
     f.close()
     os.mkfifo(pjoin(self.dir, 'fifo'))
Esempio n. 3
0
    def setUp(self):
        TempDirMixin.setUp(self)
        self.dir_orig = self.dir

        self.dir_master = pjoin(self.dir, 'master')
        self.dir_slave = pjoin(self.dir, 'slave')
        ensure_dirs(self.dir_master)
        ensure_dirs(self.dir_slave)

        self.dir = self.dir_slave

        self.master_pdir = pjoin(self.dir_master, 'profiles')
        self.pdir = self.slave_pdir = pjoin(self.dir_slave, 'profiles')
        ensure_dirs(self.master_pdir)
        ensure_dirs(self.slave_pdir)

        with open(pjoin(self.master_pdir, 'repo_name'), 'w') as f:
            f.write('master\n')
        with open(pjoin(self.slave_pdir, 'repo_name'), 'w') as f:
            f.write('slave\n')

        ensure_dirs(pjoin(self.dir_master, 'metadata'))
        ensure_dirs(pjoin(self.dir_slave, 'metadata'))
        with open(pjoin(self.dir_master, 'metadata', 'layout.conf'), 'w') as f:
            f.write('masters =\n')
        with open(pjoin(self.dir_slave, 'metadata', 'layout.conf'), 'w') as f:
            f.write('masters = master\n')
Esempio n. 4
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.subdir = pjoin(self.dir, 'dir')
     os.mkdir(self.subdir)
     f = open(pjoin(self.dir, 'file'), 'w')
     f.close()
     os.mkfifo(pjoin(self.dir, 'fifo'))
Esempio n. 5
0
    def setUp(self):
        TempDirMixin.setUp(self)
        self.pdir = pjoin(self.dir, 'profiles')
        ensure_dirs(self.pdir)

        # silence missing masters warnings
        ensure_dirs(pjoin(self.dir, 'metadata'))
        with open(pjoin(self.dir, 'metadata', 'layout.conf'), 'w') as f:
            f.write('masters =\n')
Esempio n. 6
0
 def setUp(self):
     TempDirMixin.setUp(self)
     for x, mtime in (("eclass1", 100), ("eclass2", 200)):
         open(pjoin(self.dir, "%s.eclass" % x), "w").close()
         os.utime(pjoin(self.dir, "%s.eclass" % x), (mtime, mtime))
     # insert a crap file to ensure it doesn't grab it.
     open(pjoin(self.dir, 'foon-eclass'), 'w').close()
     self.ec = eclass_cache.cache(self.dir)
     self.ec_locs = {x: self.dir for x in ("eclass1", "eclass2")}
Esempio n. 7
0
 def setUp(self):
     TempDirMixin.setUp(self)
     for x, mtime in (("eclass1", 100), ("eclass2", 200)):
         open(pjoin(self.dir, "%s.eclass" % x), "w")
         os.utime(pjoin(self.dir, "%s.eclass" % x), (mtime, mtime))
     # insert a crap file to ensure it doesn't grab it.
     open(pjoin(self.dir, 'foon-eclass'), 'w')
     self.ec = eclass_cache.cache(self.dir)
     self.ec_locs = dict((x, self.dir) for x in ("eclass1", "eclass2"))
Esempio n. 8
0
    def setUp(self):
        TempDirMixin.setUp(self)
        self.pdir = pjoin(self.dir, 'profiles')
        ensure_dirs(self.pdir)

        # silence missing masters warnings
        ensure_dirs(pjoin(self.dir, 'metadata'))
        with open(pjoin(self.dir, 'metadata', 'layout.conf'), 'w') as f:
            f.write('masters =\n')
Esempio n. 9
0
    def __init__(self, *args, **kwargs):
        TempDirMixin.__init__(self, *args, **kwargs)
        TestCase.__init__(self, *args, **kwargs)

        # default files
        self.make_globals = {}
        load_make_conf(self.make_globals,
                       pjoin(const.CONFIG_PATH, 'make.globals'))

        self.global_repos_defaults, self.global_repos_conf = load_repos_conf(
            pjoin(const.CONFIG_PATH, 'repos.conf'))
Esempio n. 10
0
    def __init__(self, *args, **kwargs):
        TempDirMixin.__init__(self, *args, **kwargs)
        TestCase.__init__(self, *args, **kwargs)

        # default files
        self.make_globals = {}
        load_make_conf(
            self.make_globals, pjoin(const.CONFIG_PATH, 'make.globals'))

        self.global_repos_defaults, self.global_repos_conf = load_repos_conf(
            pjoin(const.CONFIG_PATH, 'repos.conf'))
Esempio n. 11
0
    def setUp(self):
        TempDirMixin.setUp(self)
        self.loc1 = pjoin(self.dir, "stack1")
        self.loc2 = pjoin(self.dir, "stack2")

        os.mkdir(self.loc1)
        open(pjoin(self.loc1, 'eclass1.eclass'), 'w')
        os.utime(pjoin(self.loc1, 'eclass1.eclass'), (100, 100))
        self.ec1 = eclass_cache.cache(self.loc1)

        os.mkdir(self.loc2)
        open(pjoin(self.loc2, 'eclass2.eclass'), 'w')
        os.utime(pjoin(self.loc2, 'eclass2.eclass'), (100, 100))
        self.ec2 = eclass_cache.cache(self.loc2)
        self.ec = eclass_cache.StackedCaches([self.ec1, self.ec2])
        self.ec_locs = {"eclass1":self.loc1, "eclass2":self.loc2}
        # make a shadowed file to verify it's not seen
        open(pjoin(self.loc2, 'eclass1.eclass'), 'w')
Esempio n. 12
0
    def setUp(self):
        TempDirMixin.setUp(self)
        self.loc1 = pjoin(self.dir, "stack1")
        self.loc2 = pjoin(self.dir, "stack2")

        os.mkdir(self.loc1)
        open(pjoin(self.loc1, 'eclass1.eclass'), 'w').close()
        os.utime(pjoin(self.loc1, 'eclass1.eclass'), (100, 100))
        self.ec1 = eclass_cache.cache(self.loc1)

        os.mkdir(self.loc2)
        open(pjoin(self.loc2, 'eclass2.eclass'), 'w').close()
        os.utime(pjoin(self.loc2, 'eclass2.eclass'), (100, 100))
        self.ec2 = eclass_cache.cache(self.loc2)
        self.ec = eclass_cache.StackedCaches([self.ec1, self.ec2])
        self.ec_locs = {"eclass1": self.loc1, "eclass2": self.loc2}
        # make a shadowed file to verify it's not seen
        open(pjoin(self.loc2, 'eclass1.eclass'), 'w').close()
Esempio n. 13
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.fp = os.path.join(self.dir, "test")
     self.obj = fetchable(self.fp, chksums=chksums)
     self.fetcher = base.fetcher()
Esempio n. 14
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.fp = os.path.join(self.dir, "test")
     self.obj = fetchable(self.fp, chksums=chksums)
     self.fetcher = base.fetcher()
Esempio n. 15
0
 def tearDown(self):
     self.dir = self.dir_orig
     TempDirMixin.tearDown(self)
Esempio n. 16
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.subdir = pjoin(self.dir, 'dir')
     os.mkdir(self.subdir)
     touch(pjoin(self.dir, 'file'))
     os.mkfifo(pjoin(self.dir, 'fifo'))
Esempio n. 17
0
 def setUp(self):
     self.orig_env = os.environ["PATH"]
     TempDirMixin.setUp(self)
     os.environ["PATH"] = ":".join([self.dir] + self.orig_env.split(":"))
Esempio n. 18
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.pdir = pjoin(self.dir, 'profiles')
     ensure_dirs(self.pdir)
Esempio n. 19
0
 def tearDown(self):
     self.dir = self.dir_orig
     TempDirMixin.tearDown(self)
Esempio n. 20
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.pdir = pjoin(self.dir, 'profiles')
     ensure_dirs(self.pdir)
Esempio n. 21
0
 def setUp(self):
     self.orig_env = os.environ["PATH"]
     TempDirMixin.setUp(self)
     os.environ["PATH"] = ":".join([self.dir] + self.orig_env.split(":"))
Esempio n. 22
0
 def setUp(self, default=True):
     TempDirMixin.setUp(self)
     if default:
         self.profile = "default"
         self.mk_profile(self.profile)
Esempio n. 23
0
 def setUp(self):
     TempDirMixin.setUp(self)
     self.subdir = pjoin(self.dir, 'dir')
     os.mkdir(self.subdir)
     touch(pjoin(self.dir, 'file'))
     os.mkfifo(pjoin(self.dir, 'fifo'))
Esempio n. 24
0
 def tearDown(self):
     self.null_file.close()
     os.environ["PATH"] = self.orig_env
     TempDirMixin.tearDown(self)
Esempio n. 25
0
 def tearDown(self):
     self.null_file.close()
     os.environ["PATH"] = self.orig_env
     TempDirMixin.tearDown(self)
Esempio n. 26
0
 def tearDown(self):
     os.environ["PATH"] = self.orig_env
     TempDirMixin.tearDown(self)