@@ -40,8 +40,8 @@ def deleteIfExists(inFile):
4040 # log.warning("Exception in cleaning up %s" % inFile)
4141 # time.sleep(3)
4242
43- def cleanUp ():
44- log .info ("clean up ..." )
43+ def cleanUp (msg = None ):
44+ log .info ("cleanUp(%s) ..." % msg )
4545 shutil .rmtree ("build/unzip_boot" , ignore_errors = True )
4646 [deleteIfExists (item ) for item in [
4747 "boot.img" , "boot.img.clear" , "boot.img.google" , "boot.img.signed" , "boot.img.signed2" ,
@@ -56,7 +56,7 @@ def cleanUp():
5656 "vendor_boot-debug.img" , "vendor_boot-debug.img.clear" , "vendor_boot-debug.img.google" ]]
5757
5858def verifySingleJson (jsonFile , func = None ):
59- log .info ("executing %s ..." % jsonFile )
59+ log .info ("verifySingleJson(%s) ..." % jsonFile )
6060 imgDir = os .path .dirname (jsonFile )
6161 verifyItems = json .load (open (jsonFile ))
6262 for k , v in verifyItems ["copy" ].items ():
@@ -73,16 +73,21 @@ def verifySingleJson(jsonFile, func = None):
7373 gradleWrapper = "gradlew.bat"
7474 else :
7575 gradleWrapper = "./gradlew"
76+ log .info ("verifySingleJson::unpack" )
7677 subprocess .check_call (gradleWrapper + " unpack" , shell = True )
7778 if func :
79+ log .info ("verifySingleJson::func" )
7880 func ()
81+ log .info ("verifySingleJson::pack" )
7982 subprocess .check_call (gradleWrapper + " pack" , shell = True )
83+ log .info ("verifySingleJson::pack done" )
8084 for k , v in verifyItems ["hash" ].items ():
8185 log .info ("%s : %s" % (k , v ))
8286 unittest .TestCase ().assertIn (hashFile (k ), v .split ())
8387 try :
8488 subprocess .check_call (gradleWrapper + " clear" , shell = True )
8589 except Exception as e :
90+ log .info ("verifySingleJson: clear failed, ignore" )
8691 pass
8792
8893def verifySingleDir (inResourceDir , inImageDir ):
@@ -91,19 +96,19 @@ def verifySingleDir(inResourceDir, inImageDir):
9196 log .info ("Enter %s ..." % os .path .join (resDir , imgDir ))
9297 jsonFiles = glob .glob (os .path .join (resDir , imgDir ) + "/*.json" )
9398 for jsonFile in jsonFiles :
94- cleanUp ()
99+ cleanUp ("json_start" )
95100 verifySingleJson (jsonFile )
96- cleanUp ()
101+ cleanUp ("json_end" )
97102 pyFiles = glob .glob (os .path .join (resDir , imgDir ) + "/*.py" )
98103 for pyFile in pyFiles :
99- cleanUp ()
104+ cleanUp ("py_start" )
100105 log .warning ("calling %s" % pyFile )
101106 if sys .platform == "win32" :
102107 theCmd = "python " + pyFile
103108 else :
104109 theCmd = pyFile
105110 subprocess .check_call (theCmd , shell = True )
106- cleanUp ()
111+ cleanUp ("py_end" )
107112 log .info ("Leave %s" % os .path .join (resDir , imgDir ))
108113
109114def decompressXZ (inFile , outFile ):
0 commit comments