From d8d93e55cdf3ba955c9fe4b227bccad57573cca8 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Sun, 11 Sep 2022 03:27:15 +0800 Subject: [PATCH 01/21] Add files via upload --- lists/list_re | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 lists/list_re diff --git a/lists/list_re b/lists/list_re new file mode 100644 index 00000000..5e5229f5 --- /dev/null +++ b/lists/list_re @@ -0,0 +1,171 @@ +embedded_tiny_image_test +fastdfs +gradle +groovy +hadoop +hadoop-3.1 +hbase +isula-build +jq-issue +kf5-kconfig-core +lesscpy +libdap_20.03 +libiodbc_22.03 +libpng12 +libvirt +libvma +linux-sgx +lsyncd +mcelog +mosquitto +netdata +natlabel_tools +netperf +net-snmp +nfs-utils +nftables +nghttp2 +nginx-cli +nodejs +novnc +nss-pam-ldapd +nss_wrapper +ntfs-3g +ntp +nvmetcli +obs-server +ocaml-20.03 +ocaml-22.03 +oddjob +oemaker +opencc +opencryptoki +open-iscsi +open-isns +openldap +openmpi +openscap +opensm +opensp +openssh +openssl +openvswitch +openwsman +optipng +osc +os-storage +ostree +p7zip +pacemaker +pam +paps +pcp +psc +pscs-lite +perl-Net-Server +pesign +phodav +php +plymouth +pngquant +podman +policycoreutils +polkit +portreserve +postfix +postgresql_20.03 +powertop +pps-tools +procinfo +proftpd +prometheus2 +pwgen +python +qemu +qperf +qt5-qttools +quota +radvd +rasdaemon +rdate +rdma-core +realmd +redis6 +resource-agents +rinetd +rng-tools +robotframework +rootsh +rpcbind +rpmdevtools +rpmlint +rrdtool +rsync +rsyslog +ruby +rust +rubygem-bundler +samba +sane-backends +sanlock +sbd +sblim-sfcb +scsi-target-utils +security_test +security-tool +selinux +sendmail +smartmontools +smoke-baseinfo +smoke-baasic-os +smoke-iSulad +smoke-module +smoke-OVS +sos +spawn-fcgi +sphinx +spice-vdagent +sqlite +sqlite-jdbc +squid +sssd +storm +strongswan +stunnel +swig +sitcheroo-control +sysprof +sysstat +ststemtap +tang +targetcli +tcllib +telnet +testNG +testsuite +tftp +tidy +tigervnc +timedatex +tog-pegasus +tomcat +tpm-quote-tools_20.03 +tpm-tools_20.03 +trafficserver +tuned +udisks2 +umoci +unbound +upower +usbmuxd +uuid +uwsgi +varnish +vdo +vsftpd +watchdog +webbench +wireshark +wpa_supplicant +wrk + From 68c58b5fb9e7f7520977de0e8b1b45dd1893d563 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Fri, 7 Oct 2022 11:52:24 +0800 Subject: [PATCH 02/21] Add files via upload --- mugen_riscv_dbg.py | 371 +++++++++++++++++++++++++++++++++++++++++++++ picked.list | 68 +++++++++ 2 files changed, 439 insertions(+) create mode 100644 mugen_riscv_dbg.py create mode 100644 picked.list diff --git a/mugen_riscv_dbg.py b/mugen_riscv_dbg.py new file mode 100644 index 00000000..cc4a46d1 --- /dev/null +++ b/mugen_riscv_dbg.py @@ -0,0 +1,371 @@ +from dataclasses import replace +import os +import sys +import json +import argparse + +def LogInfo(log_content=""): + print("INFO: "+log_content) + +def LogError(log_content=""): + print("ERROR: "+log_content) + +class TestEnv(): + """ + Test environment + Including testsuites in mugen + """ + + def __init__(self): + self.is_cleared = 0 + self.suite_cases_path = "./suite2cases/" + self.suite_list = os.listdir(self.suite_cases_path) + self.suite_list_mugen = [] + self.suite_list_riscv = [] + self.list_in_suite_mugen = [] + self.list_in_suite_riscv = [] + + for i in range(len(self.suite_list)): + self.suite_list[i] = self.suite_list[i].replace(".json","") + if (self.suite_list[i].find("-riscv") != -1): + self.suite_list_riscv.append(self.suite_list[i].replace("-riscv","")) + else: + self.suite_list_mugen.append(self.suite_list[i]) + + + + def PrintSuiteNum(self): + print("Available mugen test suites num = "+str(len(self.suite_list_mugen))) + print("Available riscv test suites num = "+str(len(self.suite_list_riscv))) + + def PrintMugenSuiteList(self): + print("Available mugen test suites:") + for testsuite in self.suite_list_mugen: + print(testsuite) + + def PrintRiscvSuiteList(self): + print("Available riscv test suites:") + for testsuite in self.suite_list_riscv: + print(testsuite) + + def ClearEnv(self): + os.system("rm -rf ./results/*") + os.system("rm -f ./exec.log") + if "logs_failed" not in os.listdir("."): + os.system("mkdir logs_failed") + self.is_cleared = 1 + + def AnalyzeMissingTests(self,ana_suite): + if ana_suite is not None: + if (ana_suite in self.suite_list_riscv) and (ana_suite in self.suite_list_mugen): + mugen_file = open(self.suite_cases_path+ana_suite+".json",'r') + riscv_file = open(self.suite_cases_path+ana_suite+"-riscv.json",'r') + mugen_data = json.loads(mugen_file.read()) + riscv_data = json.loads(riscv_file.read()) + riscv_cases = [] + print("Test suite: "+ana_suite+"-riscv") + for testcase in riscv_data['cases']: + riscv_cases.append(testcase['name']) + for testcase in mugen_data['cases']: + if testcase['name'] not in riscv_cases: + print("Missing test case: "+testcase['name']) + else: + for riscv_suite in self.suite_list_riscv: + if riscv_suite in self.suite_list_mugen: + mugen_file = open(self.suite_cases_path+riscv_suite+".json",'r') + riscv_file = open(self.suite_cases_path+riscv_suite+"-riscv.json",'r') + mugen_data = json.loads(mugen_file.read()) + riscv_data = json.loads(riscv_file.read()) + riscv_cases = [] + start_tag = 0 + for testcase in riscv_data['cases']: + riscv_cases.append(testcase['name']) + for testcase in mugen_data['cases']: + if testcase['name'] not in riscv_cases: + if start_tag == 0: + start_tag = 1 + print("Test suite: "+riscv_suite+"-riscv") + print("Missing test case: "+testcase['name']) + + def test_list_in_suite(self,test_suite): + if test_suite in self.suite_list_mugen: + mugen_file = open(self.suite_cases_path+test_suite+".json",'r') + mugen_data = json.loads(mugen_file.read()) + riscv_file = open(self.suite_cases_path+test_suite+"-riscv.json",'r') + riscv_data = json.loads(riscv_file.read()) + self.list_in_suite_mugen = [testcase["name"] for testcase in mugen_data["case"]] + self.list_in_suite_riscv = [testcase["name"] for testcase in riscv_data["case"]] + + + +class TestTarget(): + """ + Test targets + """ + + def __init__(self,list_file_name=None , testSuite=None): + self.is_checked = 0 + self.is_tested = 0 + self.test_list = [] + self.unaval_test = [] + self.test_suite = testSuite + + self.success_test_num = [] + self.failed_test_num = [] + + if list_file_name is not None: + list_file = open(list_file_name,'r') + raw = list_file.read() + self.test_list = raw.split(sep="\n") + list_file.close() + + self.test_list = [x.strip() for x in self.test_list if x.strip()!=''] #Remove empty elements + self.test_list = [x.replace("-riscv","") for x in self.test_list] #Remove -riscv suffix + else: + self.test_list = [] + + def PrintTargetNum(self): + print("total test targets num = "+str(len(self.test_list))) + + def CheckTargets(self,suite_list_mugen,suite_list_riscv,mugen_native = False,qemu_mode=False): + if not qemu_mode: + conf_path = "./conf/env.json" + if not os.path.exists(conf_path): + print("环境配置文件不存在,请先配置环境信息.") + sys.exit(1) + + self.unaval_test = [] + for test_target in self.test_list : + if(((test_target not in suite_list_riscv) or mugen_native) and (test_target not in suite_list_mugen)): + self.unaval_test.append(test_target) + + for test_target in self.unaval_test : + self.test_list.remove(test_target) + + if (not mugen_native) and (self.test_suite is None): + for i in range(len(self.test_list)): + if(self.test_list[i] in suite_list_riscv): + self.test_list[i] = self.test_list[i] + "-riscv" + + self.is_checked = 1 + + def printTargets(self): + print("All targets:") + for test_target in self.test_list : + print(test_target) + + def PrintUnavalTargets(self): + print("Unavailable test targets:") + for test_target in self.unaval_test : + print(test_target) + + def PrintAvalTargets(self): + if(self.is_checked != 1): + LogError("Targets are not checked!") + return 1 + else: + print("Available test targets:") + for test_target in self.test_list : + print(test_target) + + def Run(self,detailed = 0): + if(self.is_checked != 1): + LogError("Targets are not checked!") + return 1 + elif self.test_suite is not None: + test_res = [] + for test_target in self.test_list : + print("Start to test target: "+test_target) + os.system("sudo bash mugen.sh -f "+self.test_suite+" -r "+test_target+" 2>&1 | tee -a exec.log") + if detailed == False: + temp_failed = [] + try: + temp_failed = os.listdir("results/"+test_target+"/failed") + except: + failed_num = 0 + self.failed_test_num.append(failed_num) + else: + failed_num = len(temp_failed) + self.failed_test_num.append(failed_num) + if test_target not in os.listdir('logs_failed/'): + os.system("mkdir logs_failed/"+test_target) + for failed_test in temp_failed : + if failed_test not in os.listdir('logs_failed/'+test_target+"/"): + os.system("mkdir logs_failed/"+test_target+"/"+failed_test+"/") + logs = os.listdir('logs/'+test_target+"/"+failed_test+"/") + os.system("cp logs/"+test_target+"/"+failed_test+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+failed_test+"/") + + temp_succeed = [] + try: + temp_succeed = os.listdir("results/"+test_target+"/succeed") + except: + success_num = 0 + self.success_test_num.append(success_num) + else: + success_num = len(temp_succeed) + self.success_test_num.append(success_num) + target_res = {'suite': test_target,'failed': temp_failed,'succeeded': temp_succeed} + else: + temp_failed = [] + temp_succeed = [] + success_num = 0 + failed_num = 0 + for testcase in self.test_list: + if(os.system("ls results/"+test_target+"/failed/"+testcase+" &> /dev/null") == 0): + failed_num += 1 + temp_failed.append(testcase) + if test_target not in os.listdir('logs_failed/'): + os.system("mkdir logs_failed/"+test_target) + if testcase not in os.listdir("logs_failed/"+test_target+"/"): + os.system("mkdir logs_failed/"+test_target+"/"+testcase+"/") + logs = os.listdir('logs/'+test_target+"/"+testcase+"/") + os.system("cp logs/"+test_target+"/"+testcase+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+testcase+"/") + if(os.system("ls results/"+test_target+"/succeed/"+testcase+" &> /dev/null") == 0): + temp_succeed.append(testcase) + success_num += 1 + target_res = {'suite': test_target,'failed': temp_failed,'succeed': temp_succeed} + else: + test_res = [] + for test_target in self.test_list : + print("Start to test target: "+test_target) + if detailed == False: + os.system("sudo bash mugen.sh -f "+test_target+" 2>&1 | tee -a exec.log") + temp_failed = [] + try: + temp_failed = os.listdir("results/"+test_target+"/failed") + except: + failed_num = 0 + self.failed_test_num.append(failed_num) + else: + failed_num = len(temp_failed) + self.failed_test_num.append(failed_num) + if test_target not in os.listdir('logs_failed/'): + os.system("mkdir logs_failed/"+test_target) + for failed_test in temp_failed : + if failed_test not in os.listdir('logs_failed/'+test_target+"/"): + os.system("mkdir logs_failed/"+test_target+"/"+failed_test+"/") + logs = os.listdir('logs/'+test_target+"/"+failed_test+"/") + os.system("cp logs/"+test_target+"/"+failed_test+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+failed_test+"/") + + temp_succeed = [] + try: + temp_succeed = os.listdir("results/"+test_target+"/succeed") + except: + success_num = 0 + self.success_test_num.append(success_num) + else: + success_num = len(temp_succeed) + self.success_test_num.append(success_num) + target_res = {'suite': test_target,'failed': temp_failed,'succeeded': temp_succeed} + else: + json_file = open("suite2cases/"+test_target+".json",'r') + json_raw = json_file.read() + json_data = json.loads(json_raw) + temp_failed = [] + temp_succeed = [] + success_num = 0 + failed_num = 0 + for testcasedict in json_data['cases']: + testcase = testcasedict['name'] + os.system("sudo bash mugen.sh -f "+test_target+" -r "+testcase+" 2>&1 | tee -a exec.log") + if(os.system("ls results/"+test_target+"/failed/"+testcase+" &> /dev/null") == 0): + failed_num += 1 + temp_failed.append(testcase) + if test_target not in os.listdir('logs_failed/'): + os.system("mkdir logs_failed/"+test_target) + if testcase not in os.listdir("logs_failed/"+test_target+"/"): + os.system("mkdir logs_failed/"+test_target+"/"+testcase+"/") + logs = os.listdir('logs/'+test_target+"/"+testcase+"/") + os.system("cp logs/"+test_target+"/"+testcase+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+testcase+"/") + if(os.system("ls results/"+test_target+"/succeed/"+testcase+" &> /dev/null") == 0): + temp_succeed.append(testcase) + success_num += 1 + target_res = {'suite': test_target,'failed': temp_failed,'succeed': temp_succeed} + + test_res.append(target_res) + + print("Target "+test_target+" tested "+str(success_num+failed_num)+" cases, failed "+str(failed_num)+" cases") + if(detailed == 1): + for failed_test in temp_failed : + print("Failed test: "+failed_test) + + + self.is_tested = 1 + return test_res + +class SuiteGenerator(TestEnv): + def __init__(self): + super().__init__() + self.output_path = 'suite2cases_out/' + if self.output_path.replace('/','') not in os.listdir("."): + os.system("mkdir "+self.output_path) + + def GenJson(self,test_res): + print("Json file generated at "+self.output_path) + for target in test_res: + suite_file = open(self.suite_cases_path+target['suite']+'.json','r') + suite_json = json.loads(suite_file.read()) + mugen_cases = suite_json['cases'] + out_cases = [cases for cases in mugen_cases if cases['name'] in target['succeed']] + suite_json['cases'] = out_cases + out_file = open(self.output_path+target['suite']+'.json','w') + out_file.write(json.dumps(suite_json,indent=4)) + print(self.output_path+target['suite']+'.json') + + + + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('-l',metavar='list_file',help='Specify the test targets list',dest='list_file') + parser.add_argument('-m','--mugen',action='store_true',help='Run native mugen test suites') + parser.add_argument('-a','--analyze',action='store_true',help='Analyze missing testcases') + parser.add_argument('-g','--generate',action='store_true',help='Generate testsuite json after running test') + parser.add_argument('-f',metavar='test_suite',help='Specify testsuite',dest='test_suite',default=None) + args = parser.parse_args() + + test_env = TestEnv() + test_env.ClearEnv() + test_env.PrintSuiteNum() + + if args.analyze is True: + if args.test_suite is not None: + test_env.AnalyzeMissingTests(args.test_suite) + else: + test_env.AnalyzeMissingTests(None) + else: + if (args.list_file is not None) and (args.test_suite is not None): + test_target = TestTarget(list_file_name=args.list_file , testSuite=args.test_suite) + test_target.PrintTargetNum() + test_env.test_list_in_suite(args.test_suite) + test_target.CheckTargets(suite_list_mugen=test_env.list_in_suite_mugen,suite_list_riscv=test_env.list_in_suite_riscv,mugen_native=args.mugen) + test_target.PrintUnavalTargets() + test_target.PrintAvalTargets() + test_res = test_target.Run(detailed=True) + if args.generate == True: + gen = SuiteGenerator() + gen.GenJson(test_res) + + elif args.list_file is not None: + test_target = TestTarget(list_file_name=args.list_file) + test_target.PrintTargetNum() + test_target.CheckTargets(suite_list_mugen=test_env.suite_list_mugen,suite_list_riscv=test_env.suite_list_riscv,mugen_native=args.mugen) + test_target.PrintUnavalTargets() + test_target.PrintAvalTargets() + test_res = test_target.Run(detailed=True) + if args.generate == True: + gen = SuiteGenerator() + gen.GenJson(test_res) + elif args.test_suite is not None: + test_target = TestTarget() + test_target.test_list.append(args.test_suite) + test_target.PrintTargetNum() + test_target.CheckTargets(suite_list_mugen=test_env.suite_list_mugen,suite_list_riscv=test_env.suite_list_riscv,mugen_native=args.mugen) + test_target.PrintUnavalTargets() + test_target.PrintAvalTargets() + test_res = test_target.Run(detailed=True) + if args.generate == True: + gen = SuiteGenerator() + gen.GenJson(test_res) + diff --git a/picked.list b/picked.list new file mode 100644 index 00000000..afbcc775 --- /dev/null +++ b/picked.list @@ -0,0 +1,68 @@ +oe_test_IOaccess_1Gfile +oe_test_basic_set_account_expiration_time +oe_test_date +oe_test_disk_graphics_card +oe_test_disk_schedule_specific +oe_test_disk_schedule_udev +oe_test_disk_tuned_disable +oe_test_disk_tuned_install +oe_test_disk_tuned_modify +oe_test_disk_tuned_new +oe_test_disk_tuned_set +oe_test_ethtool +oe_test_hostnamectl +oe_test_kernel_cgroup +oe_test_kernel_kdump +oe_test_kernel_module_operation +oe_test_net_IPVLAN +oe_test_net_VRF +oe_test_net_cmd_ifconfig +oe_test_net_cmd_ping +oe_test_net_cmd_scp +oe_test_net_config +oe_test_net_ncat +oe_test_net_setmode +oe_test_nmcli_8023link +oe_test_nmcli_Mgntconnect +oe_test_nmcli_add_connect +oe_test_nmcli_bridge +oe_test_nmcli_con_reload +oe_test_nmcli_config_connect +oe_test_nmcli_config_gw +oe_test_nmcli_device +oe_test_nmcli_macsec +oe_test_nmcli_route +oe_test_nmcli_set_bond +oe_test_nmcli_set_team +oe_test_nmcli_systemd_resolved +oe_test_nmcli_vlan +oe_test_power_powertop2tuned_optimize +oe_test_reboot +oe_test_server_httpd_checkfirewall +oe_test_server_httpd_port +oe_test_server_httpd_recover +oe_test_server_httpd_restart +oe_test_server_httpd_tls +oe_test_server_mariadb_backup +oe_test_server_mariadb_backupDB +oe_test_server_mariadb_backuptable +oe_test_server_mariadb_compatibilty +oe_test_server_mariadb_copy +oe_test_server_mariadb_dump +oe_test_server_mariadb_dumpMulDB +oe_test_server_mariadb_loadfile +oe_test_server_mariadb_onlinebackup +oe_test_server_mariadb_stop +oe_test_server_mysql +oe_test_server_openssh_secure +oe_test_server_openssh_verifykey +oe_test_server_postgresql +oe_test_server_squid_blacklist +oe_test_server_squid_ip +oe_test_server_squid_proxy +oe_test_server_vsftpd_NKdelay +oe_test_server_vsftpd_transfer +oe_test_system_log_view +oe_test_system_monitor_login +oe_test_system_monitor_reboot +oe_test_system_monitor_share_total From f6bcea14065644dc000e54db46d1a859b34bb6f4 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 01:43:51 +0800 Subject: [PATCH 03/21] Add files via upload --- mugen_riscv_dbg.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mugen_riscv_dbg.py b/mugen_riscv_dbg.py index cc4a46d1..93bc9aba 100644 --- a/mugen_riscv_dbg.py +++ b/mugen_riscv_dbg.py @@ -93,8 +93,8 @@ def test_list_in_suite(self,test_suite): mugen_data = json.loads(mugen_file.read()) riscv_file = open(self.suite_cases_path+test_suite+"-riscv.json",'r') riscv_data = json.loads(riscv_file.read()) - self.list_in_suite_mugen = [testcase["name"] for testcase in mugen_data["case"]] - self.list_in_suite_riscv = [testcase["name"] for testcase in riscv_data["case"]] + self.list_in_suite_mugen = [testcase["name"] for testcase in mugen_data["cases"]] + self.list_in_suite_riscv = [testcase["name"] for testcase in riscv_data["cases"]] @@ -180,7 +180,7 @@ def Run(self,detailed = 0): if detailed == False: temp_failed = [] try: - temp_failed = os.listdir("results/"+test_target+"/failed") + temp_failed = os.listdir("results/"+self.test_suite+"/failed") except: failed_num = 0 self.failed_test_num.append(failed_num) @@ -188,12 +188,12 @@ def Run(self,detailed = 0): failed_num = len(temp_failed) self.failed_test_num.append(failed_num) if test_target not in os.listdir('logs_failed/'): - os.system("mkdir logs_failed/"+test_target) + os.system("mkdir logs_failed/"+self.test_suite) for failed_test in temp_failed : - if failed_test not in os.listdir('logs_failed/'+test_target+"/"): - os.system("mkdir logs_failed/"+test_target+"/"+failed_test+"/") - logs = os.listdir('logs/'+test_target+"/"+failed_test+"/") - os.system("cp logs/"+test_target+"/"+failed_test+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+failed_test+"/") + if failed_test not in os.listdir('logs_failed/'+self.test_suite+"/"): + os.system("mkdir logs_failed/"+self.test_suite+"/"+failed_test+"/") + logs = os.listdir('logs/'+self.test_suite+"/"+failed_test+"/") + os.system("cp logs/"+self.test_suite+"/"+failed_test+"/"+logs[len(logs)-1]+" logs_failed/"+self.test_suite+"/"+failed_test+"/") temp_succeed = [] try: @@ -211,16 +211,16 @@ def Run(self,detailed = 0): success_num = 0 failed_num = 0 for testcase in self.test_list: - if(os.system("ls results/"+test_target+"/failed/"+testcase+" &> /dev/null") == 0): + if(os.system("ls results/"+self.test_suite+"/failed/"+testcase+" &> /dev/null") == 0): failed_num += 1 temp_failed.append(testcase) if test_target not in os.listdir('logs_failed/'): - os.system("mkdir logs_failed/"+test_target) - if testcase not in os.listdir("logs_failed/"+test_target+"/"): - os.system("mkdir logs_failed/"+test_target+"/"+testcase+"/") - logs = os.listdir('logs/'+test_target+"/"+testcase+"/") - os.system("cp logs/"+test_target+"/"+testcase+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+testcase+"/") - if(os.system("ls results/"+test_target+"/succeed/"+testcase+" &> /dev/null") == 0): + os.system("mkdir logs_failed/"+self.test_suite) + if testcase not in os.listdir("logs_failed/"+self.test_suite+"/"): + os.system("mkdir logs_failed/"+self.test_suite+"/"+testcase+"/") + logs = os.listdir('logs/'+self.test_suite+"/"+testcase+"/") + os.system("cp logs/"+self.test_suite+"/"+testcase+"/"+logs[len(logs)-1]+" logs_failed/"+self.test_suite+"/"+testcase+"/") + if(os.system("ls results/"+self.test_suite+"/succeed/"+testcase+" &> /dev/null") == 0): temp_succeed.append(testcase) success_num += 1 target_res = {'suite': test_target,'failed': temp_failed,'succeed': temp_succeed} From 7a5010f347d23a253dec9ad689f407a12982aa14 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 01:54:33 +0800 Subject: [PATCH 04/21] Update mugen_riscv_dbg.py --- mugen_riscv_dbg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mugen_riscv_dbg.py b/mugen_riscv_dbg.py index 93bc9aba..f379a534 100644 --- a/mugen_riscv_dbg.py +++ b/mugen_riscv_dbg.py @@ -187,7 +187,7 @@ def Run(self,detailed = 0): else: failed_num = len(temp_failed) self.failed_test_num.append(failed_num) - if test_target not in os.listdir('logs_failed/'): + if self.test_suite not in os.listdir('logs_failed/'): os.system("mkdir logs_failed/"+self.test_suite) for failed_test in temp_failed : if failed_test not in os.listdir('logs_failed/'+self.test_suite+"/"): From a26ff65fd562cc76c0e347118e3b7a40e9a23708 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 09:35:07 +0800 Subject: [PATCH 05/21] Add files via upload --- mugen_riscv_dbg.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mugen_riscv_dbg.py b/mugen_riscv_dbg.py index f379a534..d8ec8e29 100644 --- a/mugen_riscv_dbg.py +++ b/mugen_riscv_dbg.py @@ -174,9 +174,9 @@ def Run(self,detailed = 0): return 1 elif self.test_suite is not None: test_res = [] - for test_target in self.test_list : - print("Start to test target: "+test_target) - os.system("sudo bash mugen.sh -f "+self.test_suite+" -r "+test_target+" 2>&1 | tee -a exec.log") + for testTarget in self.test_list : + print("Start to test target: "+testTarget) + os.system("sudo bash mugen.sh -f "+self.test_suite+" -r "+testTarget+" 2>&1 | tee -a exec.log") if detailed == False: temp_failed = [] try: @@ -204,7 +204,7 @@ def Run(self,detailed = 0): else: success_num = len(temp_succeed) self.success_test_num.append(success_num) - target_res = {'suite': test_target,'failed': temp_failed,'succeeded': temp_succeed} + target_res = {'suite': testTarget,'failed': temp_failed,'succeeded': temp_succeed} else: temp_failed = [] temp_succeed = [] From 83bc306e9cb0e7e32afbf8a35ea83363daf1415a Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 09:43:44 +0800 Subject: [PATCH 06/21] Update mugen_riscv_dbg.py --- mugen_riscv_dbg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mugen_riscv_dbg.py b/mugen_riscv_dbg.py index d8ec8e29..175ed1ed 100644 --- a/mugen_riscv_dbg.py +++ b/mugen_riscv_dbg.py @@ -204,7 +204,7 @@ def Run(self,detailed = 0): else: success_num = len(temp_succeed) self.success_test_num.append(success_num) - target_res = {'suite': testTarget,'failed': temp_failed,'succeeded': temp_succeed} + target_res = {'suite': self.testsuite,'failed': temp_failed,'succeeded': temp_succeed} else: temp_failed = [] temp_succeed = [] From 7dcb23db56c8d08f8ff010cde9b193ee0fbe29eb Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:19:57 +0800 Subject: [PATCH 07/21] Delete mugen_riscv_dbg.py --- mugen_riscv_dbg.py | 371 --------------------------------------------- 1 file changed, 371 deletions(-) delete mode 100644 mugen_riscv_dbg.py diff --git a/mugen_riscv_dbg.py b/mugen_riscv_dbg.py deleted file mode 100644 index 175ed1ed..00000000 --- a/mugen_riscv_dbg.py +++ /dev/null @@ -1,371 +0,0 @@ -from dataclasses import replace -import os -import sys -import json -import argparse - -def LogInfo(log_content=""): - print("INFO: "+log_content) - -def LogError(log_content=""): - print("ERROR: "+log_content) - -class TestEnv(): - """ - Test environment - Including testsuites in mugen - """ - - def __init__(self): - self.is_cleared = 0 - self.suite_cases_path = "./suite2cases/" - self.suite_list = os.listdir(self.suite_cases_path) - self.suite_list_mugen = [] - self.suite_list_riscv = [] - self.list_in_suite_mugen = [] - self.list_in_suite_riscv = [] - - for i in range(len(self.suite_list)): - self.suite_list[i] = self.suite_list[i].replace(".json","") - if (self.suite_list[i].find("-riscv") != -1): - self.suite_list_riscv.append(self.suite_list[i].replace("-riscv","")) - else: - self.suite_list_mugen.append(self.suite_list[i]) - - - - def PrintSuiteNum(self): - print("Available mugen test suites num = "+str(len(self.suite_list_mugen))) - print("Available riscv test suites num = "+str(len(self.suite_list_riscv))) - - def PrintMugenSuiteList(self): - print("Available mugen test suites:") - for testsuite in self.suite_list_mugen: - print(testsuite) - - def PrintRiscvSuiteList(self): - print("Available riscv test suites:") - for testsuite in self.suite_list_riscv: - print(testsuite) - - def ClearEnv(self): - os.system("rm -rf ./results/*") - os.system("rm -f ./exec.log") - if "logs_failed" not in os.listdir("."): - os.system("mkdir logs_failed") - self.is_cleared = 1 - - def AnalyzeMissingTests(self,ana_suite): - if ana_suite is not None: - if (ana_suite in self.suite_list_riscv) and (ana_suite in self.suite_list_mugen): - mugen_file = open(self.suite_cases_path+ana_suite+".json",'r') - riscv_file = open(self.suite_cases_path+ana_suite+"-riscv.json",'r') - mugen_data = json.loads(mugen_file.read()) - riscv_data = json.loads(riscv_file.read()) - riscv_cases = [] - print("Test suite: "+ana_suite+"-riscv") - for testcase in riscv_data['cases']: - riscv_cases.append(testcase['name']) - for testcase in mugen_data['cases']: - if testcase['name'] not in riscv_cases: - print("Missing test case: "+testcase['name']) - else: - for riscv_suite in self.suite_list_riscv: - if riscv_suite in self.suite_list_mugen: - mugen_file = open(self.suite_cases_path+riscv_suite+".json",'r') - riscv_file = open(self.suite_cases_path+riscv_suite+"-riscv.json",'r') - mugen_data = json.loads(mugen_file.read()) - riscv_data = json.loads(riscv_file.read()) - riscv_cases = [] - start_tag = 0 - for testcase in riscv_data['cases']: - riscv_cases.append(testcase['name']) - for testcase in mugen_data['cases']: - if testcase['name'] not in riscv_cases: - if start_tag == 0: - start_tag = 1 - print("Test suite: "+riscv_suite+"-riscv") - print("Missing test case: "+testcase['name']) - - def test_list_in_suite(self,test_suite): - if test_suite in self.suite_list_mugen: - mugen_file = open(self.suite_cases_path+test_suite+".json",'r') - mugen_data = json.loads(mugen_file.read()) - riscv_file = open(self.suite_cases_path+test_suite+"-riscv.json",'r') - riscv_data = json.loads(riscv_file.read()) - self.list_in_suite_mugen = [testcase["name"] for testcase in mugen_data["cases"]] - self.list_in_suite_riscv = [testcase["name"] for testcase in riscv_data["cases"]] - - - -class TestTarget(): - """ - Test targets - """ - - def __init__(self,list_file_name=None , testSuite=None): - self.is_checked = 0 - self.is_tested = 0 - self.test_list = [] - self.unaval_test = [] - self.test_suite = testSuite - - self.success_test_num = [] - self.failed_test_num = [] - - if list_file_name is not None: - list_file = open(list_file_name,'r') - raw = list_file.read() - self.test_list = raw.split(sep="\n") - list_file.close() - - self.test_list = [x.strip() for x in self.test_list if x.strip()!=''] #Remove empty elements - self.test_list = [x.replace("-riscv","") for x in self.test_list] #Remove -riscv suffix - else: - self.test_list = [] - - def PrintTargetNum(self): - print("total test targets num = "+str(len(self.test_list))) - - def CheckTargets(self,suite_list_mugen,suite_list_riscv,mugen_native = False,qemu_mode=False): - if not qemu_mode: - conf_path = "./conf/env.json" - if not os.path.exists(conf_path): - print("环境配置文件不存在,请先配置环境信息.") - sys.exit(1) - - self.unaval_test = [] - for test_target in self.test_list : - if(((test_target not in suite_list_riscv) or mugen_native) and (test_target not in suite_list_mugen)): - self.unaval_test.append(test_target) - - for test_target in self.unaval_test : - self.test_list.remove(test_target) - - if (not mugen_native) and (self.test_suite is None): - for i in range(len(self.test_list)): - if(self.test_list[i] in suite_list_riscv): - self.test_list[i] = self.test_list[i] + "-riscv" - - self.is_checked = 1 - - def printTargets(self): - print("All targets:") - for test_target in self.test_list : - print(test_target) - - def PrintUnavalTargets(self): - print("Unavailable test targets:") - for test_target in self.unaval_test : - print(test_target) - - def PrintAvalTargets(self): - if(self.is_checked != 1): - LogError("Targets are not checked!") - return 1 - else: - print("Available test targets:") - for test_target in self.test_list : - print(test_target) - - def Run(self,detailed = 0): - if(self.is_checked != 1): - LogError("Targets are not checked!") - return 1 - elif self.test_suite is not None: - test_res = [] - for testTarget in self.test_list : - print("Start to test target: "+testTarget) - os.system("sudo bash mugen.sh -f "+self.test_suite+" -r "+testTarget+" 2>&1 | tee -a exec.log") - if detailed == False: - temp_failed = [] - try: - temp_failed = os.listdir("results/"+self.test_suite+"/failed") - except: - failed_num = 0 - self.failed_test_num.append(failed_num) - else: - failed_num = len(temp_failed) - self.failed_test_num.append(failed_num) - if self.test_suite not in os.listdir('logs_failed/'): - os.system("mkdir logs_failed/"+self.test_suite) - for failed_test in temp_failed : - if failed_test not in os.listdir('logs_failed/'+self.test_suite+"/"): - os.system("mkdir logs_failed/"+self.test_suite+"/"+failed_test+"/") - logs = os.listdir('logs/'+self.test_suite+"/"+failed_test+"/") - os.system("cp logs/"+self.test_suite+"/"+failed_test+"/"+logs[len(logs)-1]+" logs_failed/"+self.test_suite+"/"+failed_test+"/") - - temp_succeed = [] - try: - temp_succeed = os.listdir("results/"+test_target+"/succeed") - except: - success_num = 0 - self.success_test_num.append(success_num) - else: - success_num = len(temp_succeed) - self.success_test_num.append(success_num) - target_res = {'suite': self.testsuite,'failed': temp_failed,'succeeded': temp_succeed} - else: - temp_failed = [] - temp_succeed = [] - success_num = 0 - failed_num = 0 - for testcase in self.test_list: - if(os.system("ls results/"+self.test_suite+"/failed/"+testcase+" &> /dev/null") == 0): - failed_num += 1 - temp_failed.append(testcase) - if test_target not in os.listdir('logs_failed/'): - os.system("mkdir logs_failed/"+self.test_suite) - if testcase not in os.listdir("logs_failed/"+self.test_suite+"/"): - os.system("mkdir logs_failed/"+self.test_suite+"/"+testcase+"/") - logs = os.listdir('logs/'+self.test_suite+"/"+testcase+"/") - os.system("cp logs/"+self.test_suite+"/"+testcase+"/"+logs[len(logs)-1]+" logs_failed/"+self.test_suite+"/"+testcase+"/") - if(os.system("ls results/"+self.test_suite+"/succeed/"+testcase+" &> /dev/null") == 0): - temp_succeed.append(testcase) - success_num += 1 - target_res = {'suite': test_target,'failed': temp_failed,'succeed': temp_succeed} - else: - test_res = [] - for test_target in self.test_list : - print("Start to test target: "+test_target) - if detailed == False: - os.system("sudo bash mugen.sh -f "+test_target+" 2>&1 | tee -a exec.log") - temp_failed = [] - try: - temp_failed = os.listdir("results/"+test_target+"/failed") - except: - failed_num = 0 - self.failed_test_num.append(failed_num) - else: - failed_num = len(temp_failed) - self.failed_test_num.append(failed_num) - if test_target not in os.listdir('logs_failed/'): - os.system("mkdir logs_failed/"+test_target) - for failed_test in temp_failed : - if failed_test not in os.listdir('logs_failed/'+test_target+"/"): - os.system("mkdir logs_failed/"+test_target+"/"+failed_test+"/") - logs = os.listdir('logs/'+test_target+"/"+failed_test+"/") - os.system("cp logs/"+test_target+"/"+failed_test+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+failed_test+"/") - - temp_succeed = [] - try: - temp_succeed = os.listdir("results/"+test_target+"/succeed") - except: - success_num = 0 - self.success_test_num.append(success_num) - else: - success_num = len(temp_succeed) - self.success_test_num.append(success_num) - target_res = {'suite': test_target,'failed': temp_failed,'succeeded': temp_succeed} - else: - json_file = open("suite2cases/"+test_target+".json",'r') - json_raw = json_file.read() - json_data = json.loads(json_raw) - temp_failed = [] - temp_succeed = [] - success_num = 0 - failed_num = 0 - for testcasedict in json_data['cases']: - testcase = testcasedict['name'] - os.system("sudo bash mugen.sh -f "+test_target+" -r "+testcase+" 2>&1 | tee -a exec.log") - if(os.system("ls results/"+test_target+"/failed/"+testcase+" &> /dev/null") == 0): - failed_num += 1 - temp_failed.append(testcase) - if test_target not in os.listdir('logs_failed/'): - os.system("mkdir logs_failed/"+test_target) - if testcase not in os.listdir("logs_failed/"+test_target+"/"): - os.system("mkdir logs_failed/"+test_target+"/"+testcase+"/") - logs = os.listdir('logs/'+test_target+"/"+testcase+"/") - os.system("cp logs/"+test_target+"/"+testcase+"/"+logs[len(logs)-1]+" logs_failed/"+test_target+"/"+testcase+"/") - if(os.system("ls results/"+test_target+"/succeed/"+testcase+" &> /dev/null") == 0): - temp_succeed.append(testcase) - success_num += 1 - target_res = {'suite': test_target,'failed': temp_failed,'succeed': temp_succeed} - - test_res.append(target_res) - - print("Target "+test_target+" tested "+str(success_num+failed_num)+" cases, failed "+str(failed_num)+" cases") - if(detailed == 1): - for failed_test in temp_failed : - print("Failed test: "+failed_test) - - - self.is_tested = 1 - return test_res - -class SuiteGenerator(TestEnv): - def __init__(self): - super().__init__() - self.output_path = 'suite2cases_out/' - if self.output_path.replace('/','') not in os.listdir("."): - os.system("mkdir "+self.output_path) - - def GenJson(self,test_res): - print("Json file generated at "+self.output_path) - for target in test_res: - suite_file = open(self.suite_cases_path+target['suite']+'.json','r') - suite_json = json.loads(suite_file.read()) - mugen_cases = suite_json['cases'] - out_cases = [cases for cases in mugen_cases if cases['name'] in target['succeed']] - suite_json['cases'] = out_cases - out_file = open(self.output_path+target['suite']+'.json','w') - out_file.write(json.dumps(suite_json,indent=4)) - print(self.output_path+target['suite']+'.json') - - - - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument('-l',metavar='list_file',help='Specify the test targets list',dest='list_file') - parser.add_argument('-m','--mugen',action='store_true',help='Run native mugen test suites') - parser.add_argument('-a','--analyze',action='store_true',help='Analyze missing testcases') - parser.add_argument('-g','--generate',action='store_true',help='Generate testsuite json after running test') - parser.add_argument('-f',metavar='test_suite',help='Specify testsuite',dest='test_suite',default=None) - args = parser.parse_args() - - test_env = TestEnv() - test_env.ClearEnv() - test_env.PrintSuiteNum() - - if args.analyze is True: - if args.test_suite is not None: - test_env.AnalyzeMissingTests(args.test_suite) - else: - test_env.AnalyzeMissingTests(None) - else: - if (args.list_file is not None) and (args.test_suite is not None): - test_target = TestTarget(list_file_name=args.list_file , testSuite=args.test_suite) - test_target.PrintTargetNum() - test_env.test_list_in_suite(args.test_suite) - test_target.CheckTargets(suite_list_mugen=test_env.list_in_suite_mugen,suite_list_riscv=test_env.list_in_suite_riscv,mugen_native=args.mugen) - test_target.PrintUnavalTargets() - test_target.PrintAvalTargets() - test_res = test_target.Run(detailed=True) - if args.generate == True: - gen = SuiteGenerator() - gen.GenJson(test_res) - - elif args.list_file is not None: - test_target = TestTarget(list_file_name=args.list_file) - test_target.PrintTargetNum() - test_target.CheckTargets(suite_list_mugen=test_env.suite_list_mugen,suite_list_riscv=test_env.suite_list_riscv,mugen_native=args.mugen) - test_target.PrintUnavalTargets() - test_target.PrintAvalTargets() - test_res = test_target.Run(detailed=True) - if args.generate == True: - gen = SuiteGenerator() - gen.GenJson(test_res) - elif args.test_suite is not None: - test_target = TestTarget() - test_target.test_list.append(args.test_suite) - test_target.PrintTargetNum() - test_target.CheckTargets(suite_list_mugen=test_env.suite_list_mugen,suite_list_riscv=test_env.suite_list_riscv,mugen_native=args.mugen) - test_target.PrintUnavalTargets() - test_target.PrintAvalTargets() - test_res = test_target.Run(detailed=True) - if args.generate == True: - gen = SuiteGenerator() - gen.GenJson(test_res) - From 464fed54329817c35671c6810ef116d6174cd51e Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:20:15 +0800 Subject: [PATCH 08/21] Delete picked.list --- picked.list | 68 ----------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 picked.list diff --git a/picked.list b/picked.list deleted file mode 100644 index afbcc775..00000000 --- a/picked.list +++ /dev/null @@ -1,68 +0,0 @@ -oe_test_IOaccess_1Gfile -oe_test_basic_set_account_expiration_time -oe_test_date -oe_test_disk_graphics_card -oe_test_disk_schedule_specific -oe_test_disk_schedule_udev -oe_test_disk_tuned_disable -oe_test_disk_tuned_install -oe_test_disk_tuned_modify -oe_test_disk_tuned_new -oe_test_disk_tuned_set -oe_test_ethtool -oe_test_hostnamectl -oe_test_kernel_cgroup -oe_test_kernel_kdump -oe_test_kernel_module_operation -oe_test_net_IPVLAN -oe_test_net_VRF -oe_test_net_cmd_ifconfig -oe_test_net_cmd_ping -oe_test_net_cmd_scp -oe_test_net_config -oe_test_net_ncat -oe_test_net_setmode -oe_test_nmcli_8023link -oe_test_nmcli_Mgntconnect -oe_test_nmcli_add_connect -oe_test_nmcli_bridge -oe_test_nmcli_con_reload -oe_test_nmcli_config_connect -oe_test_nmcli_config_gw -oe_test_nmcli_device -oe_test_nmcli_macsec -oe_test_nmcli_route -oe_test_nmcli_set_bond -oe_test_nmcli_set_team -oe_test_nmcli_systemd_resolved -oe_test_nmcli_vlan -oe_test_power_powertop2tuned_optimize -oe_test_reboot -oe_test_server_httpd_checkfirewall -oe_test_server_httpd_port -oe_test_server_httpd_recover -oe_test_server_httpd_restart -oe_test_server_httpd_tls -oe_test_server_mariadb_backup -oe_test_server_mariadb_backupDB -oe_test_server_mariadb_backuptable -oe_test_server_mariadb_compatibilty -oe_test_server_mariadb_copy -oe_test_server_mariadb_dump -oe_test_server_mariadb_dumpMulDB -oe_test_server_mariadb_loadfile -oe_test_server_mariadb_onlinebackup -oe_test_server_mariadb_stop -oe_test_server_mysql -oe_test_server_openssh_secure -oe_test_server_openssh_verifykey -oe_test_server_postgresql -oe_test_server_squid_blacklist -oe_test_server_squid_ip -oe_test_server_squid_proxy -oe_test_server_vsftpd_NKdelay -oe_test_server_vsftpd_transfer -oe_test_system_log_view -oe_test_system_monitor_login -oe_test_system_monitor_reboot -oe_test_system_monitor_share_total From 548387b686b417449b19f596fd6320d1e08e0bcd Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:21:40 +0800 Subject: [PATCH 09/21] Delete list_re --- lists/list_re | 171 -------------------------------------------------- 1 file changed, 171 deletions(-) delete mode 100644 lists/list_re diff --git a/lists/list_re b/lists/list_re deleted file mode 100644 index 5e5229f5..00000000 --- a/lists/list_re +++ /dev/null @@ -1,171 +0,0 @@ -embedded_tiny_image_test -fastdfs -gradle -groovy -hadoop -hadoop-3.1 -hbase -isula-build -jq-issue -kf5-kconfig-core -lesscpy -libdap_20.03 -libiodbc_22.03 -libpng12 -libvirt -libvma -linux-sgx -lsyncd -mcelog -mosquitto -netdata -natlabel_tools -netperf -net-snmp -nfs-utils -nftables -nghttp2 -nginx-cli -nodejs -novnc -nss-pam-ldapd -nss_wrapper -ntfs-3g -ntp -nvmetcli -obs-server -ocaml-20.03 -ocaml-22.03 -oddjob -oemaker -opencc -opencryptoki -open-iscsi -open-isns -openldap -openmpi -openscap -opensm -opensp -openssh -openssl -openvswitch -openwsman -optipng -osc -os-storage -ostree -p7zip -pacemaker -pam -paps -pcp -psc -pscs-lite -perl-Net-Server -pesign -phodav -php -plymouth -pngquant -podman -policycoreutils -polkit -portreserve -postfix -postgresql_20.03 -powertop -pps-tools -procinfo -proftpd -prometheus2 -pwgen -python -qemu -qperf -qt5-qttools -quota -radvd -rasdaemon -rdate -rdma-core -realmd -redis6 -resource-agents -rinetd -rng-tools -robotframework -rootsh -rpcbind -rpmdevtools -rpmlint -rrdtool -rsync -rsyslog -ruby -rust -rubygem-bundler -samba -sane-backends -sanlock -sbd -sblim-sfcb -scsi-target-utils -security_test -security-tool -selinux -sendmail -smartmontools -smoke-baseinfo -smoke-baasic-os -smoke-iSulad -smoke-module -smoke-OVS -sos -spawn-fcgi -sphinx -spice-vdagent -sqlite -sqlite-jdbc -squid -sssd -storm -strongswan -stunnel -swig -sitcheroo-control -sysprof -sysstat -ststemtap -tang -targetcli -tcllib -telnet -testNG -testsuite -tftp -tidy -tigervnc -timedatex -tog-pegasus -tomcat -tpm-quote-tools_20.03 -tpm-tools_20.03 -trafficserver -tuned -udisks2 -umoci -unbound -upower -usbmuxd -uuid -uwsgi -varnish -vdo -vsftpd -watchdog -webbench -wireshark -wpa_supplicant -wrk - From e51760e7df71dd5091c20110238995e0a4475443 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:34:53 +0800 Subject: [PATCH 10/21] Add files via upload --- qemu_test.py | 51 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/qemu_test.py b/qemu_test.py index 55fa98b4..d507e380 100644 --- a/qemu_test.py +++ b/qemu_test.py @@ -10,7 +10,6 @@ from threading import Thread import threading import subprocess -import json def ssh_exec(qemuVM,cmd,timeout=5): conn = paramiko.SSHClient() @@ -30,8 +29,15 @@ def lstat(qemuVM,remotepath,timeout=5): conn = paramiko.SSHClient() conn.set_missing_host_key_policy(paramiko.AutoAddPolicy) conn.connect(qemuVM.ip,qemuVM.port,qemuVM.user,qemuVM.password,timeout=timeout,allow_agent=False,look_for_keys=False) - stat = paramiko.SFTPClient.from_transport(conn.get_transport()).lstat(remotepath) - ssh_cmd.pssh_close(conn) + try: + stat = paramiko.SFTPClient.from_transport(conn.get_transport()).lstat(remotepath) + except: + stat = None + else: + if stat.st_size == 0: + stat = None + finally: + ssh_cmd.pssh_close(conn) return stat def findAvalPort(num=1): @@ -75,8 +81,8 @@ def run(self): class QemuVM(object): def __init__(self,id=1,port=12055,user='root',password='openEuler12#$',vcpu=4,memory=4, - workingDir='/run/media/brsf11/30f49ecd-b387-4b8f-a70c-914110526718/VirtualMachines/RISCVoE2203Testing20220926/', - bkfile='img-base.qcow2'): + workingDir='/run/media/brsf11/30f49ecd-b387-4b8f-a70c-914110526718/VirtualMachines/RISCVoE2203Testing20220818/', + bkfile='openeuler-qemu.qcow2' , path='/root/GitRepo/mugen-riscv' , gene=False): self.id = id self.port = port self.ip = '127.0.0.1' @@ -87,6 +93,8 @@ def __init__(self,id=1,port=12055,user='root',password='openEuler12#$',vcpu=4,me self.workingDir = workingDir self.bkFile = bkfile self.drive = 'img'+str(self.id)+'.qcow2' + self.path = path + self.gene = gene def start(self): if self.drive in os.listdir(self.workingDir): @@ -134,14 +142,19 @@ def waitReady(self): def runTest(self,testsuite): - print(ssh_exec(self,'cd /root/GitRepo/mugen-riscv \n echo \''+testsuite+'\' > list_temp \n python3 mugen_riscv.py -l list_temp -g',timeout=60)[1]) - if lstat(self,'/root/GitRepo/mugen-riscv/logs_failed').st_size != 0: - sftp_get(self,'/root/GitRepo/mugen-riscv/logs_failed','',self.workingDir) - if lstat(self,'/root/GitRepo/mugen-riscv/logs').st_size != 0: - sftp_get(self,'/root/GitRepo/mugen-riscv/logs','',self.workingDir) - if lstat(self,'/root/GitRepo/mugen-riscv/suite2cases_out').st_size != 0: - sftp_get(self,'/root/GitRepo/mugen-riscv/suite2cases_out','',self.workingDir) - sftp_get(self,'/root/GitRepo/mugen-riscv/','exec.log',self.workingDir+'exec_log/'+testsuite) + if self.gene: + g = " -g" + else: + g = '' + print(ssh_exec(self,'cd /root/GitRepo/mugen-riscv \n echo \''+testsuite+'\' > list_temp \n python3 mugen_riscv.py -l list_temp'+g,timeout=60)[1]) + if lstat(self,self.path+'/logs_failed') is not None: + sftp_get(self,self.path+'/logs_failed','',self.workingDir) + if lstat(self,self.path+'/logs') is not None: + sftp_get(self,self.path+'/logs','',self.workingDir) + if lstat(self , self.path+'/suite2cases_out') is not None: + sftp_get(self,self.path+'/suite2cases_out','',self.workingDir) + sftp_get(self,self.path,'exec.log',self.workingDir+'exec_log/'+testsuite) + def isBroken(self): conn = 519 @@ -174,9 +187,11 @@ def destroy(self): parser.add_argument('-x',type=int,default=1,help='Specify threads num, default is 1') parser.add_argument('-c',type=int,default=4,help='Specify virtual machine cores num, default is 4') parser.add_argument('-M',type=int,default=4,help='Specify virtual machine memory size(GB), default is 4 GB') - parser.add_argument('-w',type=str,default='/run/media/brsf11/30f49ecd-b387-4b8f-a70c-914110526718/VirtualMachines/RISCVoE2203Testing20220926/',help='Specify working directory') + parser.add_argument('-w',type=str,default='/run/media/brsf11/30f49ecd-b387-4b8f-a70c-914110526718/VirtualMachines/RISCVoE2203Testing20220818/',help='Specify working directory') parser.add_argument('-m','--mugen',action='store_true',help='Run native mugen test suites') - parser.add_argument('-b',type=str,default='img-base.qcow2',help='Specify backing file name') + parser.add_argument('-b',type=str,default='openeuler-qemu.qcow2',help='Specify backing file name') + parser.add_argument('-d',type=str,default='/root/GitRepo/mugen-riscv',help='Specity mugen installed directory') + parser.add_argument('-g','--generate',action='store_true',help='Generate testsuite json after running test') args = parser.parse_args() test_env = TestEnv() @@ -200,12 +215,10 @@ def destroy(self): qemuVM = [] for i in range(args.x): - qemuVM.append(QemuVM(i,ports[i],vcpu=args.c,memory=args.M,workingDir=args.w,bkfile=args.b)) + qemuVM.append(QemuVM(i,ports[i],vcpu=args.c,memory=args.M,workingDir=args.w,bkfile=args.b,path=args.d,gene=args.g)) targetQueue = Queue() for target in test_target.test_list: - jsondata = json.loads(open('suite2cases/'+target+'.json','r').read()) - if len(jsondata['cases']) != 0: - targetQueue.put(target) + targetQueue.put(target) dispathcers = [] for i in range(args.x): From e2577ccddd097d55e02970e8b14390b1e76549ae Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:55:42 +0800 Subject: [PATCH 11/21] Add files via upload --- qemu_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qemu_test.py b/qemu_test.py index d507e380..76250a52 100644 --- a/qemu_test.py +++ b/qemu_test.py @@ -95,6 +95,8 @@ def __init__(self,id=1,port=12055,user='root',password='openEuler12#$',vcpu=4,me self.drive = 'img'+str(self.id)+'.qcow2' self.path = path self.gene = gene + if self.workingDir[-1] != '/': + self.workingDir += '/' def start(self): if self.drive in os.listdir(self.workingDir): @@ -146,7 +148,7 @@ def runTest(self,testsuite): g = " -g" else: g = '' - print(ssh_exec(self,'cd /root/GitRepo/mugen-riscv \n echo \''+testsuite+'\' > list_temp \n python3 mugen_riscv.py -l list_temp'+g,timeout=60)[1]) + print(ssh_exec(self,'cd '+self.path+' \n echo \''+testsuite+'\' > list_temp \n python3 mugen_riscv.py -l list_temp'+g,timeout=60)[1]) if lstat(self,self.path+'/logs_failed') is not None: sftp_get(self,self.path+'/logs_failed','',self.workingDir) if lstat(self,self.path+'/logs') is not None: @@ -191,7 +193,7 @@ def destroy(self): parser.add_argument('-m','--mugen',action='store_true',help='Run native mugen test suites') parser.add_argument('-b',type=str,default='openeuler-qemu.qcow2',help='Specify backing file name') parser.add_argument('-d',type=str,default='/root/GitRepo/mugen-riscv',help='Specity mugen installed directory') - parser.add_argument('-g','--generate',action='store_true',help='Generate testsuite json after running test') + parser.add_argument('-g','--generate',action='store_true',default=False,help='Generate testsuite json after running test') args = parser.parse_args() test_env = TestEnv() @@ -215,7 +217,7 @@ def destroy(self): qemuVM = [] for i in range(args.x): - qemuVM.append(QemuVM(i,ports[i],vcpu=args.c,memory=args.M,workingDir=args.w,bkfile=args.b,path=args.d,gene=args.g)) + qemuVM.append(QemuVM(i,ports[i],vcpu=args.c,memory=args.M,workingDir=args.w,bkfile=args.b,path=args.d.rstrip('/'),gene=args.generate)) targetQueue = Queue() for target in test_target.test_list: targetQueue.put(target) From e7f72bf968e3acec0985f4266acbcec2a469a202 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Thu, 20 Oct 2022 11:23:42 +0800 Subject: [PATCH 12/21] Add files via upload --- .../oe_test_kernel_module_operation.sh | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh diff --git a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh new file mode 100644 index 00000000..174d2e90 --- /dev/null +++ b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh @@ -0,0 +1,55 @@ +#!/usr/bin/bash + +# Copyright (c) 2022. Huawei Technologies Co.,Ltd.ALL rights reserved. +# This program is licensed under Mulan PSL v2. +# You can use it according to the terms and conditions of the Mulan PSL v2. +# http://license.coscl.org.cn/MulanPSL2 +# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more details. + +# ############################################# +# @Author : Classicriver_jia +# @Contact : classicriver_jia@foxmail.com +# @Date : 2020.5.8 +# @License : Mulan PSL v2 +# @Desc : Module operation +# ############################################ + +source ${OET_PATH}/libs/locallibs/common_lib.sh +function config_params() { + LOG_INFO "Start to config params of the case." + raw=($(depmod -n | grep -v '[/#]')) + len=${#raw[@]} + for ((i=2;i Date: Thu, 20 Oct 2022 11:24:56 +0800 Subject: [PATCH 13/21] Delete oe_test_kernel_module_operation.sh --- .../oe_test_kernel_module_operation.sh | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh diff --git a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh deleted file mode 100644 index 174d2e90..00000000 --- a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/bash - -# Copyright (c) 2022. Huawei Technologies Co.,Ltd.ALL rights reserved. -# This program is licensed under Mulan PSL v2. -# You can use it according to the terms and conditions of the Mulan PSL v2. -# http://license.coscl.org.cn/MulanPSL2 -# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -# See the Mulan PSL v2 for more details. - -# ############################################# -# @Author : Classicriver_jia -# @Contact : classicriver_jia@foxmail.com -# @Date : 2020.5.8 -# @License : Mulan PSL v2 -# @Desc : Module operation -# ############################################ - -source ${OET_PATH}/libs/locallibs/common_lib.sh -function config_params() { - LOG_INFO "Start to config params of the case." - raw=($(depmod -n | grep -v '[/#]')) - len=${#raw[@]} - for ((i=2;i Date: Thu, 20 Oct 2022 11:25:36 +0800 Subject: [PATCH 14/21] Add files via upload --- .../oe_test_kernel_module_operation.sh | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh index dec74e76..174d2e90 100755 --- a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh +++ b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh @@ -18,23 +18,37 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function config_params() { + LOG_INFO "Start to config params of the case." + raw=($(depmod -n | grep -v '[/#]')) + len=${#raw[@]} + for ((i=2;i Date: Fri, 21 Oct 2022 00:40:35 +0800 Subject: [PATCH 15/21] Add files via upload --- .../oe_test_kernel_module_operation.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh index 174d2e90..c7611c6d 100755 --- a/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh +++ b/testcases/system-test/system-integration/os-basic/oe_test_kernel_module_operation/oe_test_kernel_module_operation.sh @@ -20,6 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh function config_params() { LOG_INFO "Start to config params of the case." + depmod raw=($(depmod -n | grep -v '[/#]')) len=${#raw[@]} for ((i=2;i Date: Fri, 21 Oct 2022 00:42:29 +0800 Subject: [PATCH 16/21] Add files via upload --- .../oe_test_system_log_view/oe_test_system_log_view.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testcases/system-test/system-integration/os-basic/oe_test_system_log_view/oe_test_system_log_view.sh b/testcases/system-test/system-integration/os-basic/oe_test_system_log_view/oe_test_system_log_view.sh index 146fcd51..cd3d5e88 100755 --- a/testcases/system-test/system-integration/os-basic/oe_test_system_log_view/oe_test_system_log_view.sh +++ b/testcases/system-test/system-integration/os-basic/oe_test_system_log_view/oe_test_system_log_view.sh @@ -18,6 +18,12 @@ # ############################################# source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} + function run_test() { LOG_INFO "Start executing testcase." ls /var/log From 4cb031f3498ed8ac01343b028df1dcc0ee82c282 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Fri, 21 Oct 2022 09:51:49 +0800 Subject: [PATCH 17/21] Update qemu_test.py --- qemu_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu_test.py b/qemu_test.py index 76250a52..2c7d76ee 100644 --- a/qemu_test.py +++ b/qemu_test.py @@ -10,6 +10,7 @@ from threading import Thread import threading import subprocess +import json def ssh_exec(qemuVM,cmd,timeout=5): conn = paramiko.SSHClient() @@ -220,7 +221,9 @@ def destroy(self): qemuVM.append(QemuVM(i,ports[i],vcpu=args.c,memory=args.M,workingDir=args.w,bkfile=args.b,path=args.d.rstrip('/'),gene=args.generate)) targetQueue = Queue() for target in test_target.test_list: - targetQueue.put(target) + jsondata = json.loads(open('suite2cases/'+target+'.json','r').read()) + if len(jsondata['cases']) != 0: + targetQueue.put(target) dispathcers = [] for i in range(args.x): From a004121c9481d7f468d375b524683c9be9ad5f2d Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Fri, 21 Oct 2022 21:05:07 +0800 Subject: [PATCH 18/21] Update os-basic-riscv.json --- suite2cases/os-basic-riscv.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/suite2cases/os-basic-riscv.json b/suite2cases/os-basic-riscv.json index a0a4c97b..5714d02e 100644 --- a/suite2cases/os-basic-riscv.json +++ b/suite2cases/os-basic-riscv.json @@ -25,6 +25,9 @@ { "name": "oe_test_system_monitor_process" }, + { + "name": "oe_test_system_log_view" + }, { "name": "oe_test_system_log_security" }, @@ -157,6 +160,9 @@ { "name": "oe_test_kernel_sysctl" }, + { + "name": "oe_test_kernel_module_operation" + }, { "name": "oe_test_IOaccess_100Mfile" }, @@ -178,5 +184,8 @@ { "name": "oe_test_basic_set_permissions" } + { + "name": "oe_test_lz4" + }, ] -} \ No newline at end of file +} From 8347a105997b74d756135c559479440735705402 Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Fri, 21 Oct 2022 21:05:48 +0800 Subject: [PATCH 19/21] Update os-basic-riscv.json --- suite2cases/os-basic-riscv.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/suite2cases/os-basic-riscv.json b/suite2cases/os-basic-riscv.json index 5714d02e..c2e7d9e9 100644 --- a/suite2cases/os-basic-riscv.json +++ b/suite2cases/os-basic-riscv.json @@ -185,7 +185,7 @@ "name": "oe_test_basic_set_permissions" } { - "name": "oe_test_lz4" - }, + "name": "oe_test_lz4" + }, ] } From 7fdf42af55b4509b1f239d5595c5b2d0e91d511f Mon Sep 17 00:00:00 2001 From: KotorinMinami <98281165+KotorinMinami@users.noreply.github.com> Date: Fri, 21 Oct 2022 22:29:03 +0800 Subject: [PATCH 20/21] Update os-basic-riscv.json --- suite2cases/os-basic-riscv.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/suite2cases/os-basic-riscv.json b/suite2cases/os-basic-riscv.json index c2e7d9e9..dc4f677f 100644 --- a/suite2cases/os-basic-riscv.json +++ b/suite2cases/os-basic-riscv.json @@ -163,6 +163,9 @@ { "name": "oe_test_kernel_module_operation" }, + { + "name": "oe_test_kernel_cgroup" + }, { "name": "oe_test_IOaccess_100Mfile" }, From c25a1922c6792973c97cebc0e9e6250b107e45b2 Mon Sep 17 00:00:00 2001 From: KotorinMinami Date: Sat, 29 Oct 2022 08:43:18 +0800 Subject: [PATCH 21/21] update the rsyslog testsuite --- suite2cases/rsyslog-riscv.json | 45 +++++++++++++++++++ .../oe_test_rsyslog_abnormal_config.sh | 5 +++ .../oe_test_rsyslog_function_discard.sh | 5 +++ .../oe_test_rsyslog_function_facility.sh | 5 +++ .../oe_test_rsyslog_function_imfile.sh | 1 + .../oe_test_rsyslog_function_priority.sh | 5 +++ .../oe_test_rsyslog_function_rainerscript.sh | 5 +++ .../oe_test_rsyslog_function_shell.sh | 1 + .../oe_test_rsyslog_function_template.sh | 1 + .../oe_test_rsyslog_function_wildcard.sh | 5 +++ .../oe_test_rsyslog_parameter01.sh | 1 + .../oe_test_rsyslog_parameter02.sh | 1 + .../oe_test_rsyslog_parameter03.sh | 1 + .../oe_test_rsyslog_parameter04.sh | 1 + .../oe_test_rsyslog_reliability_operation.sh | 6 +++ .../oe_test_rsyslog_reliability_restart.sh | 1 + .../rsyslog/oe_test_service_rsyslog.sh | 5 +++ 17 files changed, 94 insertions(+) diff --git a/suite2cases/rsyslog-riscv.json b/suite2cases/rsyslog-riscv.json index a4835071..0ee6b3b4 100644 --- a/suite2cases/rsyslog-riscv.json +++ b/suite2cases/rsyslog-riscv.json @@ -1,8 +1,53 @@ { "path": "$OET_PATH/testcases/cli-test/rsyslog", "cases": [ + { + "name": "oe_test_rsyslog_abnormal_config" + }, + { + "name": "oe_test_rsyslog_function_discard" + }, + { + "name": "oe_test_rsyslog_function_facility" + }, + { + "name": "oe_test_rsyslog_function_imfile" + }, + { + "name": "oe_test_rsyslog_function_priority" + }, + { + "name": "oe_test_rsyslog_function_rainerscript" + }, + { + "name": "oe_test_rsyslog_function_shell" + }, + { + "name": "oe_test_rsyslog_function_template" + }, + { + "name": "oe_test_rsyslog_function_wildcard" + }, + { + "name": "oe_test_rsyslog_parameter01" + }, + { + "name": "oe_test_rsyslog_parameter02" + }, + { + "name": "oe_test_rsyslog_parameter03" + }, + { + "name": "oe_test_rsyslog_parameter04" + }, { "name": "oe_test_rsyslog_reliability_operation" + }, + { + "name": "oe_test_rsyslog_reliability_restart" + }, + { + "name": "oe_test_service_rsyslog" } ] } \ No newline at end of file diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_abnormal_config/oe_test_rsyslog_abnormal_config.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_abnormal_config/oe_test_rsyslog_abnormal_config.sh index 1b36aaf9..456cfa74 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_abnormal_config/oe_test_rsyslog_abnormal_config.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_abnormal_config/oe_test_rsyslog_abnormal_config.sh @@ -17,6 +17,11 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} function run_test() { LOG_INFO "Start to run test." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_discard/oe_test_rsyslog_function_discard.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_discard/oe_test_rsyslog_function_discard.sh index bc8c1c08..fdc05f7d 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_discard/oe_test_rsyslog_function_discard.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_discard/oe_test_rsyslog_function_discard.sh @@ -17,6 +17,11 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} function run_test() { LOG_INFO "Start to run test." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_facility/oe_test_rsyslog_function_facility.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_facility/oe_test_rsyslog_function_facility.sh index a2c2f844..19f39f30 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_facility/oe_test_rsyslog_function_facility.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_facility/oe_test_rsyslog_function_facility.sh @@ -17,6 +17,11 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} function run_test() { LOG_INFO "Start to run test." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_imfile/oe_test_rsyslog_function_imfile.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_imfile/oe_test_rsyslog_function_imfile.sh index 464bb47c..47025264 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_imfile/oe_test_rsyslog_function_imfile.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_imfile/oe_test_rsyslog_function_imfile.sh @@ -20,6 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog echo "temp" >/etc/rsyslog.d/test || exit 1 LOG_INFO "End to prepare the test environment." } diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_priority/oe_test_rsyslog_function_priority.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_priority/oe_test_rsyslog_function_priority.sh index ee7bc681..ff031633 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_priority/oe_test_rsyslog_function_priority.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_priority/oe_test_rsyslog_function_priority.sh @@ -17,6 +17,11 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} function run_test() { LOG_INFO "Start to run test." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_rainerscript/oe_test_rsyslog_function_rainerscript.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_rainerscript/oe_test_rsyslog_function_rainerscript.sh index cda385d0..0853e58a 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_rainerscript/oe_test_rsyslog_function_rainerscript.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_rainerscript/oe_test_rsyslog_function_rainerscript.sh @@ -17,6 +17,11 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} function run_test() { LOG_INFO "Start to run test." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_shell/oe_test_rsyslog_function_shell.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_shell/oe_test_rsyslog_function_shell.sh index 58860aa9..4350ee5e 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_function_shell/oe_test_rsyslog_function_shell.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_function_shell/oe_test_rsyslog_function_shell.sh @@ -20,6 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog cat >/opt/log_rotation_script </etc/rsyslog.d/test.conf </etc/rsyslog.d/test.conf systemctl stop rsyslog LOG_INFO "End to prepare the test environment." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter03/oe_test_rsyslog_parameter03.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter03/oe_test_rsyslog_parameter03.sh index fc8c8c5c..1b893648 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter03/oe_test_rsyslog_parameter03.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter03/oe_test_rsyslog_parameter03.sh @@ -20,6 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog echo "local7.* /var/log/test" >/etc/rsyslog.d/test.conf systemctl stop rsyslog LOG_INFO "End to prepare the test environment." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter04/oe_test_rsyslog_parameter04.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter04/oe_test_rsyslog_parameter04.sh index 083c714a..a670bbe4 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter04/oe_test_rsyslog_parameter04.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_parameter04/oe_test_rsyslog_parameter04.sh @@ -20,6 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog echo "local7.* /var/log/test" >/etc/rsyslog.d/test.conf systemctl stop rsyslog LOG_INFO "End to prepare the test environment." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_operation/oe_test_rsyslog_reliability_operation.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_operation/oe_test_rsyslog_reliability_operation.sh index ee52c395..4d31bc6f 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_operation/oe_test_rsyslog_reliability_operation.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_operation/oe_test_rsyslog_reliability_operation.sh @@ -17,6 +17,12 @@ # ############################################ source ${OET_PATH}/libs/locallibs/common_lib.sh +function pre_test() { + LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog + LOG_INFO "End to prepare the test environment." +} + function run_test() { LOG_INFO "Start to run test." diff --git a/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_restart/oe_test_rsyslog_reliability_restart.sh b/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_restart/oe_test_rsyslog_reliability_restart.sh index b3b157a7..6027a9b9 100644 --- a/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_restart/oe_test_rsyslog_reliability_restart.sh +++ b/testcases/cli-test/rsyslog/oe_test_rsyslog_reliability_restart/oe_test_rsyslog_reliability_restart.sh @@ -20,6 +20,7 @@ source ${OET_PATH}/libs/locallibs/common_lib.sh function pre_test() { LOG_INFO "Start to prepare the test environment." + DNF_INSTALL rsyslog cat >/etc/rsyslog.d/test.conf <