Beispiel #1
0
    def testShadowed(self):
        self.repos = self.openRepository()
        self.addTestPkg(1, 
                        content='''r.Create("/etc/foo", 
                                            contents="old contents\\n")''')
        self.mkbranch(self.cfg.buildLabel, "@rpl:branch", "test1:source",
                      shadow=True)
        self.cfg.buildLabel = versions.Label('localhost@rpl:branch')
        self.cfg.installLabelPath = \
                    conarycfg.CfgLabelList([self.cfg.buildLabel])
        # modify the trove on the shadow
        self.addTestPkg(1, content='''r.Create("/etc/foo", 
                                            contents="new contents\\n")''')
        self.cookTestPkg(1)
        self.updatePkg(self.rootDir, 'test1', depCheck=False)
        self.writeFile(self.rootDir + "/etc/foo", 'newer contents\\n')

        (fd, path) = tempfile.mkstemp()
        os.close(fd)
        self.localChangeset(self.rootDir, 'test1', path)
        commit.doCommit(self.cfg, path,
                        'localhost@commit:branch')
        assert(self.repos.hasTrove('test1', versions.VersionFromString(
                '/localhost@rpl:linux//branch//commit:branch/1.0-1.1-1.0.1'),
                deps.Flavor()))

        # commit it again to make sure the version gets incremented
        commit.doCommit(self.cfg, path,
                        'localhost@commit:branch')
        assert(self.repos.hasTrove('test1', versions.VersionFromString(
                '/localhost@rpl:linux//branch//commit:branch/1.0-1.1-1.0.2'),
                deps.Flavor()))

        os.remove(path)
Beispiel #2
0
    def _testBasic2(self, path, info):
        commit.doCommit(self.cfg, path,
                        'localhost@commit:branch')

        self.resetRoot()
        self.updatePkg(self.rootDir, 'info-%(user)s' % info)
        self.updatePkg(self.rootDir, 'testcase', 
                       version = 'localhost@commit:branch')
        self.verifyFile(self.rootDir + "/etc/changedconfig",
                        'new contents\n')
        self.verifyFile(self.rootDir + "/usr/share/changed",
                        'more contents\n')
        assert((os.stat(self.rootDir + "/usr/bin/hello").st_mode & 0700) 
                            == 0700)
        self.erasePkg(self.rootDir, 'testcase')
        os.remove(path)