From patchwork Wed Oct 16 01:09:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Martincoski X-Patchwork-Id: 1177482 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K4Y++Gsz"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46tDk46MDxz9sPV for ; Wed, 16 Oct 2019 12:10:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1F87A86E4F; Wed, 16 Oct 2019 01:10:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OPCdVJf-hT-w; Wed, 16 Oct 2019 01:10:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 4D91D875B9; Wed, 16 Oct 2019 01:10:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5BBA61BF4E7 for ; Wed, 16 Oct 2019 01:10:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 58284875B9 for ; Wed, 16 Oct 2019 01:10:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ny2mGVM6kDRF for ; Wed, 16 Oct 2019 01:10:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9430A86E4F for ; Wed, 16 Oct 2019 01:10:15 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id p10so21161586qkg.8 for ; Tue, 15 Oct 2019 18:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=r93HyPF0pMzTW7JSkcn9bDQQQeuV7C/pNBip/hE3K+g=; b=K4Y++Gszjox6+u9f08RQp74y8OHvq7gR8ftn3QxG6EWX7V4fjaYQ6/SIiMMSDYBHCM xl4D5LnATvGsRx/S5uxzg2yofzO1pGXGHxLhSimt44Z8QktVYodYLla7+5uW8Qb/Kmld W7K363i2h9SUVjhZnJWfSMAl7NFGlRIY4HoPaH1x3mQovb5wuN52PY1QBwZxAJ5nXp/2 AlUXNRnTQ7SGa1ez2b2xw3rEp1zbq8q/BnINgFRVFEBzuf4zf3VmSKH4LWWE5G6NHu6R X5C6ng5aT2qcUKeOVXd/9O9IPPOQHhUBArBDw6UPxU9hVXjlHkJ27zXuZ2ZXJJdGK/tE gHFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=r93HyPF0pMzTW7JSkcn9bDQQQeuV7C/pNBip/hE3K+g=; b=leuu+lpf3O9twNop6TCmjFvXZPEKSLGxMlpWKcMhz04jzwL/ySxzjWDkE97OJsguGz 561F9ejKXbUG4T4cZhbYPqmmlcUkiohhpxdLIow+TFD2CrciXEi6bLsvoU+zST/jIU92 LPEoccBL5+qp4swzGmt8322fXhWX8MprI8JNz49u8xw0UjrB7w+wBSvBs8YoyLHbzIoC JV0xSppdfeK38xL2MsqmHQkzuH3YK+KjMe6PiyRpbK2/zqPctg3PVjCzolR2JWAIpkIR C1XaPbc+iaSyi8dLlRjzuVKuD7/6qLZohRP3iYxjmEiMKIXXV6piJk5yqD+r7dYn/4lH a+rA== X-Gm-Message-State: APjAAAU78j/UfPrAkee47Ej9uXZuzWFTtwdwK84jPAOHEux6LfEMTTCc UucLXjyw/7ngDq7PTDdVtrlRsFYokvw= X-Google-Smtp-Source: APXvYqwvgkW0nT4X53jWpUIGT0UDcahiZFdy9fjHfObb/maX1sta10lh52/CKaIZo8tBKhSkJEYw/A== X-Received: by 2002:a05:620a:208a:: with SMTP id e10mr38941322qka.189.1571188214160; Tue, 15 Oct 2019 18:10:14 -0700 (PDT) Received: from ultri5.home ([186.213.129.47]) by smtp.gmail.com with ESMTPSA id n4sm11064785qkc.61.2019.10.15.18.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 18:10:13 -0700 (PDT) From: Ricardo Martincoski To: buildroot@buildroot.org Date: Tue, 15 Oct 2019 22:09:50 -0300 Message-Id: <20191016010950.19189-1-ricardo.martincoski@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH] support/testing: improve commands on syslog-ng test X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Martincoski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" There is no need for double grep, so choose a better regexp. Use && instead of ; between commands so the sequence of commands fail faster. Break the last sequence of commands in 2 calls run() so the proper return code can be tested for each. Signed-off-by: Ricardo Martincoski --- https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/322021813 --- support/testing/tests/package/test_syslog_ng.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/support/testing/tests/package/test_syslog_ng.py b/support/testing/tests/package/test_syslog_ng.py index 6cc7c18945..3fb0be5fb8 100644 --- a/support/testing/tests/package/test_syslog_ng.py +++ b/support/testing/tests/package/test_syslog_ng.py @@ -19,18 +19,20 @@ class TestSyslogNg(infra.basetest.BRTest): options=["-initrd", cpio_file]) self.emulator.login() - cmd = "grep syslog-ng /var/log/messages | grep starting" + cmd = "grep 'syslog-ng starting' /var/log/messages" _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 0) - cmd = "logger my-message;" - cmd += "sleep 1;" + cmd = "logger my-message && " + cmd += "sleep 1 && " cmd += "grep my-message /var/log/messages" _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 0) - cmd = "syslog-ng-ctl reload;" - cmd += "sleep 1;" - cmd += "grep syslog-ng /var/log/messages | grep -i warning" + cmd = "syslog-ng-ctl reload && " + cmd += "sleep 1" + _, exit_code = self.emulator.run(cmd) + self.assertEqual(exit_code, 0) + cmd = "grep -i 'syslog-ng.*warning' /var/log/messages" _, exit_code = self.emulator.run(cmd) self.assertEqual(exit_code, 1)