1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 import os
19
20 PKG = 'yumex-2.0.1-2.fc7'
21 BODHI = './bodhi-client.py'
22 IMPORT_FILE = 'bodhi-test-import'
23
25 f = open(IMPORT_FILE,'w')
26 f.write(': Bodhi update template, all entries starting with a : are ignored\n')
27 f.write('::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n')
28 f.write(':\n')
29 f.write(': Select a type: S=Security, B=Bugfix, E=Enhancement\n')
30 f.write(':\n')
31 f.write('TYPE=%s\n' % typ)
32 f.write(': Select Bug numbers to include or add you own\n')
33 f.write(': You can either use multiple BUG= statements or separate the bug numbers with a space\n')
34 f.write('BUG=282141\n')
35 f.write(': Select CVE numbers to include or add you own\n')
36 f.write(': You can either use multiple CVE= statements or separate the cve numbers with a space\n')
37 if cve:
38 f.write('CVE=CVE-2344-333\n')
39 f.write(':\n')
40 f.write(': Now edit the update notification message, everything that does not start with a : or\n')
41 f.write(': CVE=, TYPE= or BUG= will be used\n')
42 f.write('This is a yumex test update used to testing\n')
43 f.write('The Bodhi commandline client\n')
44 f.close
45
47 print '============================================================================'
48 print msg
49 print "Running : %s \n" % cmd
50 print '--> Output start'
51 os.system(cmd)
52 print '--> Output End'
53 print '\n'
54
55
56 if __name__ == "__main__":
57
58 cmd = BODHI+" -d "+ PKG
59 run(cmd,"Make sure the update dont exist ")
60
61 make_import_file('B')
62 cmd = BODHI+" -n "+ PKG + ' --file='+IMPORT_FILE
63 run(cmd,"Create an update (BUGFIX) ")
64 run(cmd,"Create an update there already exist (Should fail) ")
65
66 cmd = BODHI+" -T "+ PKG
67 run(cmd,"Push the update to testing ")
68 run(cmd,"Push the update to testing again (Should fail) ")
69 cmd = BODHI+" -S "+ PKG
70 run(cmd,"Push the update to stable (Should fail because it has a pending push) ")
71
72 cmd = BODHI+" -d "+ PKG
73 run(cmd,"Make sure the update dont exist ")
74
75 make_import_file('S',cve = True)
76 cmd = BODHI+" -n "+ PKG + ' --file='+IMPORT_FILE
77 run(cmd,"Create an update (SECURITY) ")
78
79 cmd = BODHI+" -T "+ PKG
80 run(cmd,"Push the update to testing (It should go direct to stable, insted of testing ")
81