From patchwork Wed Jan 24 22:22:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Olivain X-Patchwork-Id: 1890424 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TKz3x1MNHz23f0 for ; Thu, 25 Jan 2024 09:22:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B8D3F401B5; Wed, 24 Jan 2024 22:22:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B8D3F401B5 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I6XKpHctGSJ5; Wed, 24 Jan 2024 22:22:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 2829640149; Wed, 24 Jan 2024 22:22:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2829640149 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 545971BF831 for ; Wed, 24 Jan 2024 22:22:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3A48B8330B for ; Wed, 24 Jan 2024 22:22:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3A48B8330B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DgYJlHtenhbG for ; Wed, 24 Jan 2024 22:22:45 +0000 (UTC) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7183281EDE for ; Wed, 24 Jan 2024 22:22:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7183281EDE Received: from home.juju.sh (unknown [IPv6:2a01:e0a:485:b220:64fe:9015:874f:9d44]) (Authenticated sender: ju.o@free.fr) by smtp3-g21.free.fr (Postfix) with ESMTPSA id 7A3B213F880; Wed, 24 Jan 2024 23:22:42 +0100 (CET) From: Julien Olivain To: buildroot@buildroot.org Date: Wed, 24 Jan 2024 23:22:36 +0100 Message-ID: <20240124222236.15954-1-ju.o@free.fr> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1706134963; bh=auCBtAHtERMXEiPk8DEPLU2F6z4ExihxmJIha+9wgR8=; h=From:To:Cc:Subject:Date:From; b=Y6uKqLGfBhXTCGXBRe0uzcjycNwS3tdKhCifrjyiUgBvFW5or5cdo6mdLcCGIA4wK 57rk1ACWxhDlRPH2hwiZWDWxPSHRiF/qpGowJf62F2ENFp2HFqO5xCErnmmvnZpwHM k/ajinan4CP6Rt5zMZi4ghfOY8APv56ZNG1MxuRlMuW2nzT8VTIHW0H46hsQWg6wvb 3xDFZWgV9s3r55WM5/fSSsf7KZnsByA9+ZnnAeoJx/W/LUWjmO+dM7Qar7fUAx+5ds UI5LA0+1lh/d6iGLpoojOjmu66HEQVt5T/aM72v33Y3AtJiq1qlsH82xKjFLDyYAE7 Dv9ObC5r61SOA== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=free.fr header.i=@free.fr header.a=rsa-sha256 header.s=smtp-20201208 header.b=Y6uKqLGf Subject: [Buildroot] [PATCH 1/1] support/testing: add ltrace runtime test X-BeenThere: buildroot@buildroot.org 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: Julien Olivain Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Julien Olivain --- DEVELOPERS | 1 + support/testing/tests/package/test_ltrace.py | 32 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 support/testing/tests/package/test_ltrace.py diff --git a/DEVELOPERS b/DEVELOPERS index 9528837dd0..eea185c159 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1787,6 +1787,7 @@ F: support/testing/tests/package/test_less.py F: support/testing/tests/package/test_libgpgme.py F: support/testing/tests/package/test_libjxl.py F: support/testing/tests/package/test_lrzip.py +F: support/testing/tests/package/test_ltrace.py F: support/testing/tests/package/test_lzip.py F: support/testing/tests/package/test_lsof.py F: support/testing/tests/package/test_lz4.py diff --git a/support/testing/tests/package/test_ltrace.py b/support/testing/tests/package/test_ltrace.py new file mode 100644 index 0000000000..9ef64ba5dd --- /dev/null +++ b/support/testing/tests/package/test_ltrace.py @@ -0,0 +1,32 @@ +import os + +import infra.basetest + + +class TestLtrace(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_LTRACE=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + # Check the program can execute + self.assertRunOk("ltrace --version") + + # Run ltrace on a ls + cmd = "ltrace -a 0 -o ltrace.log ls /" + self.assertRunOk(cmd) + + # Check the ltrace log contains occurrences of libc malloc() + cmd = "grep -Ec 'malloc\\([0-9]+\\)' ltrace.log" + out, ret = self.emulator.run(cmd) + self.assertEqual(ret, 0) + self.assertGreater(int(out[0]), 0)