From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EDEC3A034E; Mon, 31 Jan 2022 22:33:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD5DF41190; Mon, 31 Jan 2022 22:33:47 +0100 (CET) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 3855340042 for ; Mon, 31 Jan 2022 22:33:47 +0100 (CET) Received: by inbox.dpdk.org (Postfix, from userid 33) id 11991A0353; Mon, 31 Jan 2022 22:33:47 +0100 (CET) From: bugzilla@dpdk.org To: dts@dpdk.org Subject: [Bug 931] Trex config file (yaml) will break dts with valid yaml Date: Mon, 31 Jan 2022 21:33:46 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DTS X-Bugzilla-Component: framework X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ohilyard@iol.unh.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dts@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org https://bugs.dpdk.org/show_bug.cgi?id=3D931 Bug ID: 931 Summary: Trex config file (yaml) will break dts with valid yaml Product: DTS Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Normal Component: framework Assignee: dts@dpdk.org Reporter: ohilyard@iol.unh.edu Target Milestone: --- framework/crb.py:503 (check_trex_process_existed) ``` if 'config_file' in conf_info: config_file =3D conf_info['config_file'] else: config_file =3D '/etc/trex_cfg.yaml' fd =3D open(config_file, 'r') output =3D fd.read() fd.close() prefix =3D re.search("prefix\s*:\s*(\S*)", output) if prefix is not None: self.trex_prefix =3D prefix.group(1) ``` This will break if quotes are used even though 'prefix: "trex1"' and 'prefi= x: trex1' are semantically equivalent. An actual yaml parser should be used to extract this information to avoid this fragility. --=20 You are receiving this mail because: You are the assignee for the bug.=