Exemple #1
0
    def test_rmdir_fails_purge(self):
        self.setupStep(
            svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                    mode='full',
                    keep_on_purge=['svn_external_path/unversioned_file1']))

        self.expectCommands(
            ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
            ExpectLogged('stat', {
                'file': 'wkdir/.svn',
                'logEnviron': True
            }) + 0,
            ExpectShell(workdir='wkdir',
                        command=[
                            'svn', 'status', '--xml', '--no-ignore',
                            '--non-interactive', '--no-auth-cache'
                        ]) + ExpectShell.log('stdio', stdout=self.svn_st_xml) +
            0,
            ExpectLogged(
                'rmdir', {
                    'dir': 'wkdir/svn_external_path/unversioned_file2',
                    'logEnviron': True
                }) + 1,
        )
        self.expectOutcome(result=FAILURE, status_text=["updating"])
        return self.runStep()
Exemple #2
0
    def test_mode_full_copy(self):
        self.setupStep(
            cvs.CVS(cvsroot=":pserver:[email protected]:/cvsroot",
                    cvsmodule="mozilla/browser/", mode='full', method='copy',
                    login=True))
        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        command=['cvs', '--version'])
            + 0,
            ExpectLogged('rmdir', dict(dir='wkdir',
                                       logEnviron=True))
            + 0,
            ExpectLogged('stat', dict(file='source/CVS',
                                      logEnviron=True))
            + 0,            
            ExpectShell(workdir='source',
                        command=['cvs', '-z3', 'update', '-dP'])
            + 0,
            ExpectLogged('cpdir', {'fromdir': 'source', 'todir': 'build',
                                   'logEnviron': True})
            + 0,
            )

        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
Exemple #3
0
    def test_mode_full_fresh_clobberOnFailure(self):
        self.setupStep(
                git.Git(repourl='http://github.com/buildbot/buildbot.git',
                        mode='full', method='fresh', clobberOnFailure=True))

        self.expectCommands(
            ExpectLogged('stat', dict(file='wkdir/.git'))
            + 1,
            ExpectShell(workdir='wkdir',
                        command=['git', 'clone',
                                 'http://github.com/buildbot/buildbot.git', '.'])
            + 1,
            ExpectLogged('rmdir', dict(dir='wkdir'))
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'clone', 
                                 'http://github.com/buildbot/buildbot.git',
                                 '.'])
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'rev-parse', 'HEAD'])
            + ExpectShell.log('stdio',
                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
            + 0,
        )
        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
Exemple #4
0
    def test_mode_full_copy(self):
        self.setupStep(
                git.Git(repourl='http://github.com/buildbot/buildbot.git',
                        mode='full', method='copy', shallow=True))

        self.expectCommands(
            ExpectLogged('rmdir', dict(dir='wkdir')),
            ExpectLogged('stat', dict(file='source/.git'))
            + 0,
            ExpectShell(workdir='source',
                        command=['git', 'fetch', '-t',
                                 'http://github.com/buildbot/buildbot.git',
                                 'master'])
            + 0,
            ExpectShell(workdir='source',
                        command=['git', 'reset', '--hard', 'FETCH_HEAD'])
            + 0,
            ExpectLogged('cpdir', {'fromdir': 'source', 'todir': 'build'})
            + 0,
            ExpectShell(workdir='build',
                        command=['git', 'rev-parse', 'HEAD'])
            + ExpectShell.log('stdio',
                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
            + 0,
        )
        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
Exemple #5
0
 def test_mode_copy(self):
     self.setupStep(
         svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                 mode='full',
                 method='copy'))
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
         ExpectLogged('rmdir', dict(dir='wkdir', logEnviron=True)) + 0,
         ExpectLogged('stat', dict(file='source/.svn', logEnviron=True)) +
         0,
         ExpectShell(workdir='source',
                     command=[
                         'svn', 'update', '--non-interactive',
                         '--no-auth-cache'
                     ]) + 0,
         ExpectLogged('cpdir', {
             'fromdir': 'source',
             'todir': 'wkdir',
             'logEnviron': True
         }) + 0,
         ExpectShell(workdir='wkdir', command=['svnversion']) +
         ExpectShell.log('stdio', stdout='100') + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #6
0
 def test_mode_full_copy(self):
     self.setupStep(
         bzr.Bzr(repourl='http://bzr.squid-cache.org/bzr/squid3/trunk',
                 mode='full', method='copy'))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['bzr', '--version'])
         + 0,
         ExpectLogged('rmdir', dict(dir='build',
                                    logEnviron=True))
         + 0,
         ExpectLogged('stat', dict(file='source/.bzr',
                                   logEnviron=True))
         + 0,
         ExpectShell(workdir='source',
                     command=['bzr', 'update'])
         + 0,
         ExpectLogged('cpdir', {'fromdir': 'source',
                                'logEnviron': True,
                                'todir': 'build'})
         + 0,
         ExpectShell(workdir='source',
                     command=['bzr', 'version-info', '--custom', "--template='{revno}"])
         + ExpectShell.log('stdio',
             stdout='100')
         + 0,
         )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
 def test_mode_incremental_branch_change(self):
     self.setupStep(
         mercurial.Mercurial(repourl='http://hg.mozilla.org',
                             mode='incremental',
                             branchType='inrepo'), dict(branch='stable', ))
     self.expectCommands(
         ExpectLogged('stat', dict(file='wkdir/.hg')) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'hg', '--verbose', 'pull', 'http://hg.mozilla.org',
                         '--update'
                     ]) + 0,
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', 'identify', '--branch']) +
         ExpectShell.log('stdio', stdout='default') + 0,
         ExpectLogged('rmdir', dict(dir='wkdir')) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'hg', '--verbose', 'clone', '--noupdate',
                         'http://hg.mozilla.org', '.'
                     ]) + 0,
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', 'update', '--clean']) + 0,
         ExpectShell(
             workdir='wkdir',
             command=['hg', '--verbose', 'identify', '--id', '--debug']) +
         ExpectShell.log('stdio', stdout='\n') + ExpectShell.log(
             'stdio', stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d') +
         0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #8
0
 def test_mode_incremental_logEnviron(self):
     self.setupStep(
         svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                 mode='incremental',
                 username='******',
                 password='******',
                 extra_args=['--random'],
                 logEnviron=False))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['svn', '--version'],
                     logEnviron=False) + 0,
         ExpectLogged('stat', dict(file='wkdir/.svn', logEnviron=False)) +
         0,
         ExpectShell(
             workdir='wkdir',
             command=[
                 'svn', 'update', '--non-interactive', '--no-auth-cache',
                 '--username', 'user', '--password', 'pass', '--random'
             ],
             logEnviron=False) + 0,
         ExpectShell(
             workdir='wkdir', command=['svnversion'], logEnviron=False) +
         ExpectShell.log('stdio', stdout='100') + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #9
0
 def test_mode_full_clean(self):
     self.setupStep(
         svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                 mode='full',
                 method='clean'))
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
         ExpectLogged('stat', {
             'file': 'wkdir/.svn',
             'logEnviron': True
         }) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'svn', 'status', '--xml', '--non-interactive',
                         '--no-auth-cache'
                     ]) +
         ExpectShell.log('stdio', stdout=self.svn_st_xml_empty) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'svn', 'update', '--non-interactive',
                         '--no-auth-cache'
                     ]) + 0,
         ExpectShell(workdir='wkdir', command=['svnversion']) +
         ExpectShell.log('stdio', stdout='100\n') + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #10
0
 def test_mode_full_clobber(self):
     self.setupStep(
         mercurial.Mercurial(repourl='http://hg.mozilla.org',
                             mode='full',
                             method='clobber',
                             branchType='inrepo'))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', '--version']) + 0,
         ExpectLogged('rmdir', dict(dir='wkdir', logEnviron=True)) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'hg', '--verbose', 'clone', '--noupdate',
                         'http://hg.mozilla.org', '.'
                     ]) + 0,
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', 'update', '--clean']) + 0,
         ExpectShell(
             workdir='wkdir',
             command=['hg', '--verbose', 'identify', '--id', '--debug']) +
         ExpectShell.log(
             'stdio', stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d') +
         0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #11
0
 def test_mode_incremental_no_existing_repo_dirname(self):
     self.setupStep(
         mercurial.Mercurial(baseURL='http://hg.mozilla.org',
                             mode='incremental',
                             branchType='dirname'), )
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', '--version']) + 0,
         ExpectLogged('stat', dict(file='wkdir/.hg', logEnviron=True)) +
         1,  # does not exist
         ExpectShell(workdir='wkdir',
                     command=[
                         'hg', '--verbose', 'clone',
                         'http://hg.mozilla.org', '.', '--noupdate'
                     ]) + 0,
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', 'update', '--clean']) + 0,
         ExpectShell(
             workdir='wkdir',
             command=['hg', '--verbose', 'identify', '--id', '--debug']) +
         ExpectShell.log('stdio', stdout='\n') + ExpectShell.log(
             'stdio', stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d') +
         0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #12
0
 def test_mode_incremental_given_revision(self):
     self.setupStep(
             git.Git(repourl='http://github.com/buildbot/buildbot.git',
                                 mode='incremental'), dict(
             revision='abcdef01',
             ))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['git', '--version'])
         + 0,
         ExpectLogged('stat', dict(file='wkdir/.git',
                                   logEnviron=True))
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'cat-file', '-e', 'abcdef01'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'reset', '--hard', 'abcdef01'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'rev-parse', 'HEAD'])
         + ExpectShell.log('stdio',
             stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
         + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #13
0
    def test_mode_full_clobber_submodule(self):
        self.setupStep(
                git.Git(repourl='http://github.com/buildbot/buildbot.git',
                        mode='full', method='clobber', submodules=True))

        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        command=['git', '--version'])
            + 0,
            ExpectLogged('rmdir', dict(dir='wkdir',
                                       logEnviron=True))
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'clone',
                                 'http://github.com/buildbot/buildbot.git', '.'])
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'submodule', 'update',
                                 '--init', '--recursive'])
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'rev-parse', 'HEAD'])
            + ExpectShell.log('stdio',
                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
            + 0,
        )
        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
 def test_mode_full_clean(self):
     self.setupStep(
         mercurial.Mercurial(repourl='http://hg.mozilla.org',
                             mode='full',
                             method='clean',
                             branchType='inrepo'))
     self.expectCommands(
         ExpectLogged('stat', dict(file='wkdir/.hg')) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'hg', '--verbose', '--config', 'extensions.purge=',
                         'purge'
                     ]) + 0,
         ExpectShell(
             workdir='wkdir',
             command=['hg', '--verbose', 'pull', 'http://hg.mozilla.org']) +
         0,
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', 'identify', '--branch']) +
         ExpectShell.log('stdio', stdout='default') + 0,
         ExpectShell(workdir='wkdir',
                     command=['hg', '--verbose', 'update', '--clean']) + 0,
         ExpectShell(
             workdir='wkdir',
             command=['hg', '--verbose', 'identify', '--id', '--debug']) +
         ExpectShell.log('stdio', stdout='\n') + ExpectShell.log(
             'stdio', stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d') +
         0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #15
0
 def test_mode_full_no_method(self):
     self.setupStep(
             git.Git(repourl='http://github.com/buildbot/buildbot.git',
                                 mode='full'))
     self.expectCommands(
         ExpectLogged('stat', dict(file='wkdir/.git'))
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'clean', '-f', '-d', '-x'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'fetch', '-t',
                              'http://github.com/buildbot/buildbot.git',
                              'master'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'reset', '--hard', 'FETCH_HEAD'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'rev-parse', 'HEAD'])
         + ExpectShell.log('stdio',
             stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
         + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #16
0
 def test_mode_full_revision(self):
     self.setupStep(
         bzr.Bzr(repourl='http://bzr.squid-cache.org/bzr/squid3/trunk',
                 mode='full', method='fresh'),
         args=dict(revision='3730'))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['bzr', '--version'])
         + 0,
         ExpectLogged('stat', dict(file='wkdir/.bzr',
                                   logEnviron=True))
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['bzr', 'clean-tree', '--force'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['bzr', 'update', '-r', '3730'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['bzr', 'version-info', '--custom', "--template='{revno}"])
         + ExpectShell.log('stdio',
             stdout='100')
         + 0,
                 )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #17
0
 def test_mode_full_clean_parsefail(self):
     self.setupStep(
             git.Git(repourl='http://github.com/buildbot/buildbot.git',
                                 mode='full', method='clean'))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['git', '--version'])
         + 0,
         ExpectLogged('stat', dict(file='wkdir/.git',
                                   logEnviron=True))
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'clean', '-f', '-d'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'fetch', '-t',
                              'http://github.com/buildbot/buildbot.git',
                              'master'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'reset', '--hard', 'FETCH_HEAD'])
         + ExpectShell.log('stdio',
             stderr="fatal: Could not parse object " 
                 "'b08076bc71c7813038f2cefedff9c5b678d225a8'.\n")
         + 128,
     )
     self.expectOutcome(result=FAILURE, status_text=["updating"])
     return self.runStep()
Exemple #18
0
 def test_revparse_failure(self):
     self.setupStep(
             git.Git(repourl='http://github.com/buildbot/buildbot.git',
                     mode='full', method='clobber', progress=True), dict(
             revision='abcdef01',
             ))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['git', '--version'])
         + 0,
         ExpectLogged('rmdir', dict(dir='wkdir',
                                    logEnviron=True))
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'clone',
                              'http://github.com/buildbot/buildbot.git',
                              '.', '--progress'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'reset', '--hard', 'abcdef01'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'rev-parse', 'HEAD'])
         + ExpectShell.log('stdio',
             stdout='f6ada95a1d') # too short
         + 0,
     )
     self.expectOutcome(result=FAILURE, status_text=["updating"])
     return self.runStep()
Exemple #19
0
 def test_mode_full_clobber_given_revision(self):
     self.setupStep(
             git.Git(repourl='http://github.com/buildbot/buildbot.git',
                     mode='full', method='clobber', progress=True), dict(
             revision='abcdef01',
             ))
     self.expectCommands(
         ExpectLogged('rmdir', dict(dir='wkdir'))
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'clone',
                              'http://github.com/buildbot/buildbot.git',
                              '.', '--progress'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'reset', '--hard', 'abcdef01'])
         + 0,
         ExpectShell(workdir='wkdir',
                     command=['git', 'rev-parse', 'HEAD'])
         + ExpectShell.log('stdio',
             stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
         + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #20
0
 def test_not_found(self):
     self.setupStep(slave.FileExists(file="x"))
     self.expectCommands(
         ExpectLogged('stat', { 'file' : 'x' })
         + ExpectLogged.update('stat', [0, 99, 99])
         + 0
     )
     self.expectOutcome(result=FAILURE,
             status_text=["Not a file."])
     return self.runStep()
Exemple #21
0
 def test_found(self):
     self.setupStep(slave.FileExists(file="x"))
     self.expectCommands(
         ExpectLogged('stat', { 'file' : 'x' })
         + ExpectLogged.update('stat', [stat.S_IFREG, 99, 99])
         + 0
     )
     self.expectOutcome(result=SUCCESS,
             status_text=["File found."])
     return self.runStep()
Exemple #22
0
 def test_rmdir_fails_copy(self):
     self.setupStep(
         svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                 mode='full',
                 method='copy'))
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
         ExpectLogged('rmdir', dict(dir='wkdir', logEnviron=True)) + 1,
     )
     self.expectOutcome(result=FAILURE, status_text=["updating"])
     return self.runStep()
Exemple #23
0
    def test_mode_full_clean_new_rmdir(self):
        self.setupStep(
            svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                    mode='full',
                    method='clean'))

        self.patch_slaveVersionIsOlderThan(True)
        self.expectCommands(
            ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
            ExpectLogged('stat', {
                'file': 'wkdir/.svn',
                'logEnviron': True
            }) + 0,
            ExpectShell(workdir='wkdir',
                        command=[
                            'svn', 'status', '--xml', '--non-interactive',
                            '--no-auth-cache'
                        ]) + ExpectShell.log('stdio', stdout=self.svn_st_xml) +
            0,
            ExpectLogged(
                'rmdir', {
                    'dir': [
                        'wkdir/svn_external_path/unversioned_file1',
                        'wkdir/svn_external_path/unversioned_file2'
                    ],
                    'logEnviron':
                    True
                }) + 0,
            ExpectShell(workdir='wkdir',
                        command=[
                            'svn', 'update', '--non-interactive',
                            '--no-auth-cache'
                        ]) + 0,
            ExpectShell(workdir='wkdir', command=['svnversion']) +
            ExpectShell.log('stdio', stdout='100') + 0,
        )
        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
Exemple #24
0
    def test_mode_incremental_clobberOnFailure(self):
        self.setupStep(
                git.Git(repourl='http://github.com/buildbot/buildbot.git',
                        mode='incremental', clobberOnFailure=True))

        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        command=['git', '--version'])
            + 0,
            ExpectLogged('stat', dict(file='wkdir/.git',
                                      logEnviron=True))
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'fetch', '-t',
                                 'http://github.com/buildbot/buildbot.git',
                                 'master'])
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'reset', '--hard', 'FETCH_HEAD'])
            + 1,
            ExpectLogged('rmdir', dict(dir='wkdir',
                                       logEnviron=True))
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'clone',
                                 'http://github.com/buildbot/buildbot.git',
                                 '.'])
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['git', 'rev-parse', 'HEAD'])
            + ExpectShell.log('stdio',
                stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d')
            + 0,
        )
        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
Exemple #25
0
 def test_mode_incremental_given_revision(self):
     self.setupStep(
         svn.SVN(svnurl='http://svn.local/app/trunk@HEAD',
                 mode='incremental'), dict(revision='100', ))
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
         ExpectLogged('stat', dict(file='wkdir/.svn', logEnviron=True)) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'svn', 'update', '--revision', '100',
                         '--non-interactive', '--no-auth-cache'
                     ]) + 0,
         ExpectShell(workdir='wkdir', command=['svnversion']) +
         ExpectShell.log('stdio', stdout='100') + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #26
0
 def test_mode_incremental_baseURL(self):
     self.setupStep(
         svn.SVN(baseURL='http://svn.local/',
                 mode='incremental',
                 defaultBranch='trunk'))
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['svn', '--version']) + 0,
         ExpectLogged('stat', dict(file='wkdir/.svn', logEnviron=True)) + 0,
         ExpectShell(workdir='wkdir',
                     command=[
                         'svn', 'update', '--non-interactive',
                         '--no-auth-cache'
                     ]) + 0,
         ExpectShell(workdir='wkdir', command=['svnversion']) +
         ExpectShell.log('stdio', stdout='100') + 0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
 def test_mode_incremental_no_existing_repo(self):
     self.setupStep(
         git.Git(repourl='http://github.com/buildbot/buildbot.git',
                 mode='incremental'))
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['git', '--version']) + 0,
         ExpectLogged('stat', dict(file='wkdir/.git')) + 1,
         ExpectShell(workdir='wkdir',
                     command=[
                         'git', 'clone',
                         'http://github.com/buildbot/buildbot.git', '.'
                     ]) + 0,
         ExpectShell(workdir='wkdir', command=['git', 'rev-parse', 'HEAD'])
         + ExpectShell.log(
             'stdio', stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d') +
         0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #28
0
    def test_mode_incremental(self):
        self.setupStep(
            cvs.CVS(cvsroot=":pserver:[email protected]:/cvsroot",
                    cvsmodule="mozilla/browser/", mode='incremental',
                    login=True))
        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        command=['cvs', '--version'])
            + 0,
            ExpectLogged('stat', dict(file='wkdir/CVS',
                                      logEnviron=True))
            + 0,            
            ExpectShell(workdir='wkdir',
                        command=['cvs', '-z3', 'update', '-dP'])
            + 0,
            )

        self.expectOutcome(result=SUCCESS, status_text=["update"])
        return self.runStep()
Exemple #29
0
 def test_bad_checkout(self):
     self.setupStep(
         bzr.Bzr(repourl='http://bzr.squid-cache.org/bzr/squid3/trunk',
                 mode='incremental'))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['bzr', '--version'])
         + 0,
         ExpectLogged('stat', dict(file='wkdir/.bzr',
                                   logEnviron=True))
         + 1,
         ExpectShell(workdir='wkdir',
                     command=['bzr', 'checkout',
                             'http://bzr.squid-cache.org/bzr/squid3/trunk', '.'])
         + ExpectShell.log('stdio',
             stderr='failed\n')
         + 128,
         )
     self.expectOutcome(result=FAILURE, status_text=["updating"])
     return self.runStep()
Exemple #30
0
 def test_mode_full_clean_no_existing_repo(self):
     self.setupStep(
         cvs.CVS(cvsroot=":pserver:[email protected]:/cvsroot",
                 cvsmodule="mozilla/browser/", mode='full', method='clean',
                 login=True))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['cvs', '--version'])
         + 0,
         ExpectLogged('stat', dict(file='wkdir/CVS',
                                   logEnviron=True))
         + 1,
         ExpectShell(workdir='',
                     command=['cvs',
                              '-d',
                              ':pserver:[email protected]:/cvsroot',
                              '-z3', 'checkout', '-d', 'wkdir', 'mozilla/browser/'])
         + 0,
         )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()
Exemple #31
0
    def test_cvsdiscard_fails(self):
        self.setupStep(
            cvs.CVS(cvsroot=":pserver:[email protected]:/cvsroot",
                    cvsmodule="mozilla/browser/", mode='full', method='fresh',
                    login=True))
        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        command=['cvs', '--version'])
            + 0,
            ExpectLogged('stat', dict(file='wkdir/CVS',
                                      logEnviron=True))
            + 0,
            ExpectShell(workdir='wkdir',
                        command=['cvsdiscard', '--ignore'])
            + ExpectShell.log('stdio',
                stderr='FAIL!\n')
            + 1,
            )

        self.expectOutcome(result=FAILURE, status_text=["updating"])
        return self.runStep()
 def test_mode_full_fresh_no_existing_repo(self):
     self.setupStep(
         mercurial.Mercurial(repourl='http://hg.mozilla.org',
                             mode='full',
                             method='fresh',
                             branchType='inrepo'))
     self.expectCommands(
         ExpectLogged('stat', dict(file='wkdir/.hg')) + 1,
         ExpectShell(workdir='wkdir',
                     command=[
                         'hg', '--verbose', 'clone',
                         'http://hg.mozilla.org', '.'
                     ]) + 0,
         ExpectShell(
             workdir='wkdir',
             command=['hg', '--verbose', 'identify', '--id', '--debug']) +
         ExpectShell.log('stdio', stdout='\n') + ExpectShell.log(
             'stdio', stdout='f6ad368298bd941e934a41f3babc827b2aa95a1d') +
         0,
     )
     self.expectOutcome(result=SUCCESS, status_text=["update"])
     return self.runStep()