~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to DistUpgrade/automatic-upgrade-testing

  • Committer: Sebastian Heinlein
  • Date: 2007-01-18 20:34:02 UTC
  • mfrom: (424 main)
  • mto: (337.5.12 separation)
  • mto: This revision was merged to the branch mainline in revision 442.
  • Revision ID: sebi@sebi-laptop-20070118203402-5a8578e52099912e
* merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import os
6
6
import sys
7
7
import glob
 
8
import shutil
8
9
 
9
10
# TODO:
10
11
# - show held-back packages 
11
12
# - if no terminal activity for a extended time, send a '\n' on the
12
13
#   terminal (assuming its a stupid maintainer script asking questions)
13
14
 
 
15
def login(profile, basedir):
 
16
    chroot = Chroot(profile, basedir)
 
17
    chroot.bootstrap()
 
18
    d = chroot._unpackToTmpdir(chroot.tarball)
 
19
    print "logging into: '%s'" % d
 
20
    chroot._runInChroot(d, ["/bin/sh"])
 
21
    print "Cleaning up"
 
22
    if d:
 
23
        shutil.rmtree(d)
 
24
    
14
25
def testUpgrade(profile, basedir):
15
26
 
16
27
    # setup log
40
51
    parser.add_option("-a", "--auto", dest="auto", default=False,
41
52
                      action="store_true",
42
53
                      help="run all tests in profile/ dir")
 
54
    parser.add_option("-l", "--login", dest="login", default=False,
 
55
                      action="store_true",
 
56
                      help="log into the a profile")
 
57
    
43
58
    
44
59
    (options, args) = parser.parse_args()
45
60
    basedir = os.getcwd()
48
63
        for d in glob.glob("./profile/*/DistUpgrade.cfg"):
49
64
            #print "Testing: ",d
50
65
            testUpgrade(d, basedir)
 
66
    elif options.login:
 
67
        login(options.profile, basedir)
51
68
    else:
52
69
        testUpgrade(options.profile, basedir)
53
70