def test_update(self):
     self.setupStep(pbuilder.DebCowbuilder())
     self.expectCommands(
         Expect('stat',
                {'file': '/var/cache/pbuilder/stable-local-buildbot.cow/'})
         + Expect.update('stat',
                         [stat.S_IFDIR, 99, 99, 1, 0, 0, 99, 0, 0, 0]) + 0,
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=[
                         'sudo',
                         '/usr/sbin/cowbuilder',
                         '--update',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow/',
                     ]) + 0,
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=[
                         'pdebuild', '--buildresult', '.', '--pbuilder',
                         '/usr/sbin/cowbuilder', '--', '--buildresult', '.',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow/'
                     ]) + 0)
     self.expectOutcome(result=SUCCESS)
     return self.runStep()
 def test_new(self):
     self.setupStep(pbuilder.DebCowbuilder())
     self.expectCommands(
         Expect('stat',
                {'file': '/var/cache/pbuilder/stable-local-buildbot.cow/'})
         + 1,
         ExpectShell(
             workdir='wkdir',
             usePTY='slave-config',
             command=[
                 'sudo', '/usr/sbin/cowbuilder', '--create', '--basepath',
                 '/var/cache/pbuilder/stable-local-buildbot.cow/',
                 '--distribution', 'stable', '--mirror',
                 'http://cdn.debian.net/debian/'
             ]) + 0,
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=[
                         'pdebuild', '--buildresult', '.', '--pbuilder',
                         '/usr/sbin/cowbuilder', '--', '--buildresult', '.',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow/'
                     ]) + 0)
     self.expectOutcome(result=SUCCESS)
     return self.runStep()
Exemple #3
0
 def test_update_reg(self):
     self.setupStep(pbuilder.DebCowbuilder(basetgz='/var/cache/pbuilder/stable-local-buildbot.cow'))
     self.expectCommands(
         Expect('stat', {'file': '/var/cache/pbuilder/stable-local-buildbot.cow'})
         + Expect.update('stat', [stat.S_IFREG, 99, 99, 1, 0, 0, 99, 0, 0, 0])
         + 0,
         ExpectShell(workdir='wkdir', usePTY='slave-config',
                     command=['sudo', '/usr/sbin/cowbuilder', '--update',
                              '--basepath', '/var/cache/pbuilder/stable-local-buildbot.cow'])
         + 1)
     self.expectOutcome(result=FAILURE, state_string='built (failure)')
     return self.runStep()
 def test_buildonly(self):
     self.setup_step(pbuilder.DebCowbuilder())
     self.expect_commands(
         ExpectStat(file='/var/cache/pbuilder/stable-local-buildbot.cow/').
         stat_dir(mtime=int(time.time())).exit(0),
         ExpectShell(workdir='wkdir',
                     command=[
                         'pdebuild', '--buildresult', '.', '--pbuilder',
                         '/usr/sbin/cowbuilder', '--', '--buildresult', '.',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow/'
                     ]).exit(0))
     self.expect_outcome(result=SUCCESS)
     return self.run_step()
 def test_update_reg(self):
     self.setup_step(
         pbuilder.DebCowbuilder(
             basetgz='/var/cache/pbuilder/stable-local-buildbot.cow'))
     self.expect_commands(
         ExpectStat(file='/var/cache/pbuilder/stable-local-buildbot.cow').
         stat_file().exit(0),
         ExpectShell(workdir='wkdir',
                     command=[
                         'sudo', '/usr/sbin/cowbuilder', '--update',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow'
                     ]).exit(1))
     self.expect_outcome(result=FAILURE, state_string='built (failure)')
     return self.run_step()
Exemple #6
0
 def test_buildonly_reg(self):
     self.setupStep(pbuilder.DebCowbuilder(
         basetgz='/var/cache/pbuilder/stable-local-buildbot.cow'))
     self.expectCommands(
         Expect(
             'stat', {'file': '/var/cache/pbuilder/stable-local-buildbot.cow'})
         +
         Expect.update(
             'stat', [stat.S_IFREG, 99, 99, 1, 0, 0, 99, 0, int(time.time()), 0])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['pdebuild', '--buildresult', '.',
                              '--pbuilder', '/usr/sbin/cowbuilder', '--', '--buildresult', '.',
                              '--basepath', '/var/cache/pbuilder/stable-local-buildbot.cow'])
         + 1)
     self.expectOutcome(result=FAILURE, state_string='built (failure)')
     return self.runStep()
 def test_new(self):
     self.setup_step(pbuilder.DebCowbuilder())
     self.expect_commands(
         ExpectStat(
             file='/var/cache/pbuilder/stable-local-buildbot.cow/').exit(1),
         ExpectShell(workdir='wkdir',
                     command=[
                         'sudo', '/usr/sbin/cowbuilder', '--create',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow/',
                         '--distribution', 'stable', '--mirror',
                         'http://cdn.debian.net/debian/'
                     ]).exit(0),
         ExpectShell(workdir='wkdir',
                     command=[
                         'pdebuild', '--buildresult', '.', '--pbuilder',
                         '/usr/sbin/cowbuilder', '--', '--buildresult', '.',
                         '--basepath',
                         '/var/cache/pbuilder/stable-local-buildbot.cow/'
                     ]).exit(0))
     self.expect_outcome(result=SUCCESS)
     return self.run_step()