~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to AutoUpgradeTester/automatic-upgrade-testing

  • Committer: Michael Vogt
  • Date: 2007-08-01 20:46:12 UTC
  • Revision ID: michael.vogt@ubuntu.com-20070801204612-2iahbfu59zmq75qd
* AutoUpgradeTester/*
  - moved the upgrade tester code to its own directory
* AutoUpgradeTester/profile/*:
  - fixes for the new location
* AutoUpgradeTester/profile/etch-server/:
  - added etch upgrade test (not work yet)
* AutoUpgradeTester/automatic-upgrade-testing:
  - return proper exit status
* DistUpgrade/DistUpgradeCache.py:
  - log if DistUpgradeCache.markInstall() fails
  - added checkPriority() that will ensure that the configured
    priority is always present on upgrade (currently set to 'required')
  - added Distro/AllowUnauthenticated option
* DistUpgrade/DistUpgradeControler.py:
  - if on rewriting the sources.list everything fails (no mirror,
    enabling via aptsources) fallback to just overwriting it
  - do not crash if a BaseDependency can not be found in the cache
  - error out if backports can not be found (pre-requists)
  - copy main.log to main_pre_req.log before restarting itself
* DistUpgrade/DistUpgradeViewNonInteractive.py:
  - fix automatic re-runing of broken maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
import datetime
10
10
 
 
11
sys.path = [os.path.normpath(os.path.join(os.getcwd(),"../DistUpgrade"))] + sys.path
11
12
from UpgradeTestBackend import UpgradeTestBackend
12
13
 
13
14
# TODO:
82
83
if __name__ == "__main__":
83
84
 
84
85
    parser = OptionParser()
85
 
    parser.add_option("-p", "--profile", dest="profile", default="default",
 
86
    parser.add_option("-p", "--profile", dest="profile", default="profile/ubuntu/DistUpgrade.cfg",
86
87
                      help="write report to FILE")
87
88
    parser.add_option("-a", "--auto", dest="auto", default=False,
88
89
                      action="store_true",
102
103
    fd1 = os.dup(1)
103
104
    fd2 = os.dup(2)
104
105
 
105
 
    if options.auto:
106
 
        for d in glob.glob("./profile/*/DistUpgrade.cfg"):
107
 
            os.dup2(fd1, 1)
108
 
            os.dup2(fd2, 2)
109
 
            print "Testing '%s'" % d
110
 
            testUpgrade(options.backend, d, basedir)
111
 
    elif options.login:
112
 
        backend = createBackend(options.backend, options.profile, basedir)
113
 
        login(backend)
114
 
    else:
115
 
        testUpgrade(options.backend, options.profile, basedir)
116
 
    
 
106
    res = True
 
107
    try:
 
108
        if options.auto:
 
109
            for d in glob.glob("./profile/*/DistUpgrade.cfg"):
 
110
                os.dup2(fd1, 1)
 
111
                os.dup2(fd2, 2)
 
112
                print "Testing '%s'" % d
 
113
                res &= testUpgrade(options.backend, d, basedir)
 
114
        elif options.login:
 
115
            backend = createBackend(options.backend, options.profile, basedir)
 
116
            login(backend)
 
117
        else:
 
118
            res &= testUpgrade(options.backend, options.profile, basedir)
 
119
    except Exception, e:
 
120
        print "ERROR: expection caught '%s' " % e
 
121
        res = False
117
122
 
 
123
    # return error
 
124
    sys.exit(not res)