From d4afcbc51e745edae12993c4c44fb97081a709d0 Mon Sep 17 00:00:00 2001 From: cuixucui <350255958@qq.com> Date: Fri, 19 Jun 2020 06:38:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3id=E5=8F=82=E6=95=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwcompatible/command.py | 2 +- hwcompatible/compatibility.py | 5 +++-- server/server.py | 12 ++++++------ tests/memory/memory.py | 1 + tests/system/system.py | 8 ++++---- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/hwcompatible/command.py b/hwcompatible/command.py index aa6810f..ab850f8 100755 --- a/hwcompatible/command.py +++ b/hwcompatible/command.py @@ -124,7 +124,7 @@ class Command: if self.pipe: return self.pipe.poll() - def _get_str(self, regex=None, regex_group=None, single_line=True, return_list=False, ignore_errors=False): + def _get_str(self, regex=None, regex_group=None, single_line=True, return_list=False): self.regex = regex self.single_line = single_line self.regex_group = regex_group diff --git a/hwcompatible/compatibility.py b/hwcompatible/compatibility.py index 09576cc..f7221d6 100755 --- a/hwcompatible/compatibility.py +++ b/hwcompatible/compatibility.py @@ -146,6 +146,7 @@ class EulerCertification(): def submit(self): packages = list() pattern = re.compile("^oech-[0-9]{14}-[0-9a-zA-Z]{10}.tar$") + files = [] for (root, dirs, files) in os.walk(CertEnv.datadirectory): break packages.extend(filter(pattern.search, files)) @@ -268,8 +269,8 @@ class EulerCertification(): if device.get_property("ID_CDROM") == "1": types = ["DVD_RW", "DVD_PLUS_RW", "DVD_R", "DVD_PLUS_R", "DVD", \ "BD_RE", "BD_R", "BD", "CD_RW", "CD_R", "CD"] - for type in types: - if device.get_property("ID_CDROM_" + type) == "1": + for dev_type in types: + if device.get_property("ID_CDROM_" + dev_type) == "1": try: sort_devices["cdrom"].extend([device]) except KeyError: diff --git a/server/server.py b/server/server.py index 677db18..858c4f4 100755 --- a/server/server.py +++ b/server/server.py @@ -71,7 +71,7 @@ def get_results(): return render_template('results.html', results=results) -@app.route('/results///') +@app.route('/results///') def get_job(host, oec_id, job): dir_job = os.path.join(dir_results, host, oec_id, job) json_info = os.path.join(dir_job, 'compatibility.json') @@ -86,7 +86,7 @@ def get_job(host, oec_id, job): return render_template('job.html', host=host, id=oec_id, job=job, info=info, results=results) -@app.route('/results////devices/') +@app.route('/results////devices/') def get_device(host, oec_id, job, interface): dir_job = os.path.join(dir_results, host, oec_id, job) json_results = os.path.join(dir_job, 'factory.json') @@ -103,7 +103,7 @@ def get_device(host, oec_id, job, interface): abort(404) -@app.route('/results////devices') +@app.route('/results////devices') def get_devices(host, oec_id, job): dir_job = os.path.join(dir_results, host, oec_id, job) json_devices = os.path.join(dir_job, 'device.json') @@ -115,7 +115,7 @@ def get_devices(host, oec_id, job): return render_template('devices.html', devices=devices) -@app.route('/results////attachment') +@app.route('/results////attachment') def get_attachment(host, oec_id, job): dir_job = os.path.join(dir_results, host, oec_id, job) attachment = dir_job + '.tar.gz' @@ -124,7 +124,7 @@ def get_attachment(host, oec_id, job): return send_from_directory(filedir, filename, as_attachment=True) -@app.route('/results////logs/') +@app.route('/results////logs/') def get_log(host, oec_id, job, name): dir_job = os.path.join(dir_results, host, oec_id, job) logpath = os.path.join(dir_job, name + '.log') @@ -138,7 +138,7 @@ def get_log(host, oec_id, job, name): return render_template('log.html', name=name, log=log) -@app.route('/results////submit') +@app.route('/results////submit') def submit(host, oec_id, job): dir_job = os.path.join(dir_results, host, oec_id, job) tar_job = dir_job + '.tar.gz' diff --git a/tests/memory/memory.py b/tests/memory/memory.py index 8464c15..fe2eac1 100755 --- a/tests/memory/memory.py +++ b/tests/memory/memory.py @@ -58,6 +58,7 @@ class MemoryTest(Test): self.free_memory = 0 self.system_memory = 0 self.swap_memory = 0 + self.hugepage_size = 0 self.hugepage_total = 0 self.hugepage_free = 0 while True: diff --git a/tests/system/system.py b/tests/system/system.py index f27cd06..2935443 100755 --- a/tests/system/system.py +++ b/tests/system/system.py @@ -161,10 +161,10 @@ class SystemTest(Test): def abi_check(self, module): whitelist_path = [("/lib/modules/kabi-current/kabi_whitelist_" + self.sysinfo.arch), - ("/lib/modules/kabi/kabi_whitelist_" + self.sysinfo.arch), - ("/usr/src/kernels/%s/kabi_whitelist" % self.sysinfo.kernel) - ] - + ("/lib/modules/kabi/kabi_whitelist_" + self.sysinfo.arch), + ("/usr/src/kernels/%s/kabi_whitelist" % self.sysinfo.kernel) + ] + whitelist = "" for whitelist in whitelist_path: if os.path.exists(whitelist): break -- GitLab