From: utk.tiwari Date: Tue, 27 May 2025 10:26:07 +0000 (+0530) Subject: [TCT][Scripts][Non-ACR] Making install.log file profile/arch wise X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F324828%2F2;p=test%2Ftct%2Fnative%2Fapi.git [TCT][Scripts][Non-ACR] Making install.log file profile/arch wise Change-Id: I35be7bc26fce770d2835c862fbaedaeb7473ac42 Signed-off-by: utk.tiwari --- diff --git a/scripts_tpk/tpk-install.py b/scripts_tpk/tpk-install.py index 96df9ac30..f04627dc6 100755 --- a/scripts_tpk/tpk-install.py +++ b/scripts_tpk/tpk-install.py @@ -56,8 +56,10 @@ def removeDir(path): def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE): rpmCheck=False + global TYPE_GIVEN global INSTALL_PKG_COUNT if ( TYPE == None ): + TYPE_GIVEN=False install('ctc', None, PROFILE, TC_COUNT, ARCH, COVERAGE) install('itc', None, PROFILE, TC_COUNT, ARCH, COVERAGE) install('utc', None, PROFILE, TC_COUNT, ARCH, COVERAGE) @@ -196,7 +198,10 @@ def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE): print('**************Task finished successfully*********************') print('') os.chdir(PROJECT_DIR) - logFile=open('install.log', 'a') + if TYPE_GIVEN: + logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'_'+TYPE+'.log', 'a') + else: + logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'.log', 'a') logFile.write(TYPE+':->'+MODNAME+'\n') logFile.close() INSTALL_PKG_COUNT+=1 @@ -261,11 +266,16 @@ if ( len(sys.argv) >= 6 ): if ( len(sys.argv) >= 7 ): module=sys.argv[6] +if build_ctype: + TYPE_GIVEN=True + INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'_'+build_ctype+'.log' +else: + INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'.log' -if ( os.path.exists('install.log') ): - os.remove('install.log') +if ( os.path.exists(INSTALL_LOG_PATH) ): + os.remove(INSTALL_LOG_PATH) -instLog=open('install.log', 'w') +instLog=open(INSTALL_LOG_PATH, 'w') instLog.write('**********************************************\n') instLog.write('Following packages get installed successfully:\n') instLog.close() @@ -273,15 +283,15 @@ instLog.close() install(build_ctype, module, profile,tc_count, arch, is_coverage) if ( module == None ): - instLog=open('install.log', 'a') + instLog=open(INSTALL_LOG_PATH, 'a') instLog.write('**********************************************\n') instLog.write('Total Intall PASS Count = ' + str(INSTALL_PKG_COUNT) + '\n') instLog.close() - instLog=open('install.log') + instLog=open(INSTALL_LOG_PATH) for line in instLog: print(line.strip('\n')) instLog.close() -os.remove('install.log') +os.remove(INSTALL_LOG_PATH) diff --git a/scripts_tpk/tpksdk-install.py b/scripts_tpk/tpksdk-install.py index 543121824..26abe7fc9 100755 --- a/scripts_tpk/tpksdk-install.py +++ b/scripts_tpk/tpksdk-install.py @@ -56,8 +56,10 @@ def removeDir(path): def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE): rpmCheck=False + global TYPE_GIVEN global INSTALL_PKG_COUNT if ( TYPE == None ): + TYPE_GIVEN=False install('ctc', None, PROFILE, TC_COUNT, ARCH, COVERAGE) install('itc', None, PROFILE, TC_COUNT, ARCH, COVERAGE) install('utc', None, PROFILE, TC_COUNT, ARCH, COVERAGE) @@ -187,7 +189,10 @@ def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH, COVERAGE): print('**************Task finished successfully*********************') print('') os.chdir(PROJECT_DIR) - logFile=open('install.log', 'a') + if TYPE_GIVEN: + logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'_'+TYPE+'.log', 'a') + else: + logFile=open('install'+'_'+sys.argv[2]+'_'+sys.argv[1]+'.log', 'a') logFile.write(TYPE+':->'+MODNAME+'\n') logFile.close() INSTALL_PKG_COUNT+=1 @@ -255,10 +260,16 @@ if ( arch == 'x86_64' ): if ( arch == 'riscv64' ): arch='riscv64' -if ( os.path.exists('install.log') ): - os.remove('install.log') +if build_ctype: + TYPE_GIVEN=True + INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'_'+build_ctype+'.log' +else: + INSTALL_LOG_PATH = 'install'+'_'+profile+'_'+arch+'.log' + +if ( os.path.exists(INSTALL_LOG_PATH) ): + os.remove(INSTALL_LOG_PATH) -instLog=open('install.log', 'w') +instLog=open(INSTALL_LOG_PATH, 'w') instLog.write('**********************************************\n') instLog.write('Following packages get installed successfully:\n') instLog.close() @@ -266,13 +277,13 @@ instLog.close() install(build_ctype, module, profile,tc_count, arch, is_coverage) if ( module == None ): - instLog=open('install.log', 'a') + instLog=open(INSTALL_LOG_PATH, 'a') instLog.write('**********************************************\n') instLog.write('Total Intall PASS Count = ' + str(INSTALL_PKG_COUNT) + '\n') instLog.close() - instLog=open('install.log') + instLog=open(INSTALL_LOG_PATH) for line in instLog: print(line.strip('\n')) instLog.close() -os.remove('install.log') +os.remove(INSTALL_LOG_PATH)