30
30
import configparser
31
31
import sys
32
32
from testcases import Build_bisector
33
+ from testcases import Email_git
33
34
from common .OpTestSystem import OpSystemState
34
35
from common .OpTestSOL import OpSOLMonitorThread
35
36
from common .Exceptions import CommandFailed
@@ -60,6 +61,7 @@ def setUp(self):
60
61
self .bisect_category = self .conf .args .bisect_category
61
62
self .append_kernel_cmdline = self .conf .args .append_kernel_cmdline
62
63
self .linux_path = os .path .join (self .home , "linux" )
64
+ self .bisect_flag = self .conf .args .bisect_flag
63
65
if not self .repo :
64
66
self .fail ("Provide git repo of kernel to install" )
65
67
if not (self .conf .args .host_ip and self .conf .args .host_user and self .conf .args .host_password ):
@@ -92,8 +94,13 @@ def runTest(self):
92
94
self .branch = 'master'
93
95
log .info ("CD DONE" )
94
96
95
- self .connection .run_command ("git clone --depth 1 {} -b {}" .format (self .repo , self .branch ))
97
+ self .connection .run_command ("git clone -b {} {} linux" .format ( self .branch , self .repo ),timeout = 3000 )
98
+ # self.connection.run_command("git reset --hard ")
96
99
self .connection .run_command ("cd linux" )
100
+ # self.connection.run_command("git tag")
101
+ # self.connection.run_command("git checkout next-20240229")
102
+
103
+ # self.connection.run_command("git reset --hard next-20240229")
97
104
commit = self .connection .run_command (" git log -1 --format=%H" )
98
105
self .connection .run_command ("cd .." )
99
106
self .connection .run_command ("wget http://ltc-jenkins.aus.stglabs.ibm.com:81/abdul/ioci/kernel_config -o linux/.config" )
@@ -107,16 +114,24 @@ def runTest(self):
107
114
if exit_code != 0 :
108
115
entry = self .Store_loc (errVal )[- 1 ]
109
116
badCommit = commit [- 1 ]
110
- log .info ("BUILD_BISECTOR CALLED" )
111
- bisect = Build_bisector .Buil_bisector ()
112
- bisect .setUp ()
113
- res = bisect .runTest ()
114
- log .info ("BUILD_BISECTOR END" )
115
- em = res [0 ]
116
- commiti = res [1 ]
117
- else :
118
- em = ""
117
+ if self .bisect_flag == True or self .bisect_flag == 'true' :
118
+ log .info ("BUILD_BISECTOR CALLED" )
119
+ bisect = Build_bisector .Buil_bisector ()
120
+ bisect .setUp ()
121
+ res = bisect .runTest ()
122
+ log .info ("BUILD_BISECTOR END" )
123
+ emaili = res [0 ]
124
+ commiti = res [1 ]
125
+ log .info ("COMMIT REVERT HAS TO BE CHECKED MANUALLY" )
126
+ else :
127
+ emaili = ""
128
+ commiti = commit [- 1 ]
129
+ else :
130
+ emaili = ""
119
131
commiti = commit [- 1 ]
120
132
with open ('output.json' ,'w' ) as f :
121
- json .dump ({"exit_code" :exit_code ,"email" :em ,"commit" : commiti ,"error" :entry },f )
133
+ json .dump ({"exit_code" :exit_code ,"email" :emaili ,"commit" : commiti ,"error" :entry ,"flag" :self .bisect_flag },f )
134
+ email = Email_git .Email_git ()
135
+ email .setUp ()
136
+ res = email .runTest ()
122
137
return exit_code
0 commit comments