From patchwork Tue Apr 3 15:25:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Victor Kamensky \(kamensky\)" X-Patchwork-Id: 132756 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3943366ljb; Tue, 3 Apr 2018 08:25:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx483Mvi4Che+XV8NAQwrb3w5D+uEzjRwCTcSXPerYiWIx80sZfat9zFveOsCK1Wbo8OSiu/c X-Received: by 10.99.135.199 with SMTP id i190mr9345808pge.2.1522769119682; Tue, 03 Apr 2018 08:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522769119; cv=none; d=google.com; s=arc-20160816; b=rg5ptplHXefQqDFhb6WjpnY07466ZBSLQWeGj6V/yrzi31gmLmTFcQ9QHshGBM8/6d yJvsmiMfwLPLvxwT2A7SHnFIcCd9bYYR/IHYnEsSVGDR3NbpqQn4Tq6TCC1ybnkSW0Fu O0i8Z52G676uhC4rM2kDB05AZIVNWR4C5Wibup5Ndxh13GdkU+mOPU1M2bzCTqcKZlw1 sZ2EZ1p2k/MdFpl4maJWDaG/treWGAW7LvPMTddE+zQLxKT6BgUaScJtYZma9bQO/b8G oElG5h2EcyoRQWBIX2aHY7ACwJ0lXus5uJJ7bZoz7t3oGE8WgFXxg5DKDlTBIGgyZ8N1 uGyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=s/hK3iqEavp0xndhr/9ehQ10lQfiWC6H+Egaz8YK2Tw=; b=p0NgVzW4ozhjk6bgISsBQuaJ5KriBSlm/Ya83HGKiFB+w0KJriS7RkEXWPX+yI4PhW wj6Jo7cMK7cAlKWSzjIamZkN7MnAkOtPBjzUY+I0v4sAFH3fKiNE02yS8KEtw5igxJJ8 aE2PTYMXa6XXN2omI6F99N9yDAXc+wvx62OFOSM9z4YrOgc9Y8Gp4QB+GOGbqEi/jfEJ R+MEYBKrymw0RY58kupcZozd1xfmAc84mFXrAKequ6i2IMCqn2I0XPAHBCL45twSE6/o LbpzugQe/9DNHYXGWOm5UXvPfE5WP7mCusrecOynO8z8c0F3/NLKgSif6hS2x/uQXo9Q s2hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=jnjf0ztd; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id u5si2203437pgo.144.2018.04.03.08.25.19; Tue, 03 Apr 2018 08:25:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=jnjf0ztd; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id B26C9749C3; Tue, 3 Apr 2018 15:25:14 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by mail.openembedded.org (Postfix) with ESMTP id E9A5F74953 for ; Tue, 3 Apr 2018 15:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2605; q=dns/txt; s=iport; t=1522769115; x=1523978715; h=from:to:cc:subject:date:message-id; bh=DljciNfIQgRBu2hvrWa9/ftHYyQBBjhA3VtDk0Ckuwk=; b=jnjf0ztdSW9jXQQ+1aYkt9veUlamL8HpNVoyQcHvXkhXno6Pwph8H2CA 49KIikx+9IjrlFAChzklFhvexpDWZnQyGUkogcOGwWGbHsDeM7KSXtVKS roeSghCAQA1YHQNNMQJBrpEMv+c1GG61XGLTPU0HiRwv5y9Z1kmn1kB87 A=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AXAgAgnMNa/49dJa1dGQEBAQEBAQEBAQEBAQcBAQEBAYNCYW8omGSDA5RPCxuEaIREITcVAQIBAQEBAQECayiGIoFRhQ2vMIhDgiWHYYITg1yBf4NwhQgCjFOKaAiFUohdAoFoik2PVgIREwGBJTIigVJNIxWCfQmCFxeONh8wjj0BAQ X-IronPort-AV: E=Sophos;i="5.48,401,1517875200"; d="scan'208";a="374177555" Received: from rcdn-core-7.cisco.com ([173.37.93.143]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 15:25:12 +0000 Received: from kamensky-w541.cisco.com ([10.82.174.186]) (authenticated bits=0) by rcdn-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id w33FP1rp001083 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Tue, 3 Apr 2018 15:25:10 GMT From: Victor Kamensky To: openembedded-core@lists.openembedded.org Date: Tue, 3 Apr 2018 08:25:01 -0700 Message-Id: <1522769101-4576-1-git-send-email-kamensky@cisco.com> X-Mailer: git-send-email 2.7.4 X-Authenticated-User: kamensky@cisco.com Cc: Alexander Kanavin Subject: [OE-core] [PATCH v2] oeqa/runtime/stap.py: add runtime test for systemtap X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Add runtime test for stap to test basic SystemTap operations: can compile very basic module and run on target device. Note we disable (-DSTP_NO_VERREL_CHECK) SystemTap additional kernel release check since during OE testing mismatching kernel-devsrc and kernels are used. Signed-off-by: Victor Kamensky --- v2 updates: * prepare in /usr/src/kernel make as in kernelmodule.py * use of uname -r for kernel release retrieval * adds -DSTP_NO_VERREL_CHECK to allow mismatch between running kernel and kernel-devsrc meta/lib/oeqa/runtime/cases/stap.py | 33 +++++++++++++++++++++++++++++++++ meta/lib/oeqa/runtime/files/hello.stp | 1 + 2 files changed, 34 insertions(+) create mode 100644 meta/lib/oeqa/runtime/cases/stap.py create mode 100644 meta/lib/oeqa/runtime/files/hello.stp -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oeqa/runtime/cases/stap.py b/meta/lib/oeqa/runtime/cases/stap.py new file mode 100644 index 0000000..fc728bf --- /dev/null +++ b/meta/lib/oeqa/runtime/cases/stap.py @@ -0,0 +1,33 @@ +import os + +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.core.decorator.oeid import OETestID +from oeqa.core.decorator.data import skipIfNotFeature + +class StapTest(OERuntimeTestCase): + + @classmethod + def setUpClass(cls): + src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp') + dst = '/tmp/hello.stp' + cls.tc.target.copyTo(src, dst) + + @classmethod + def tearDownClass(cls): + files = '/tmp/hello.stp' + cls.tc.target.run('rm %s' % files) + + @OETestID(1652) + @skipIfNotFeature('tools-profile', + 'Test requires tools-profile to be in IMAGE_FEATURES') + @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module']) + def test_stap(self): + cmds = [ + 'cd /usr/src/kernel && make scripts prepare', + 'cd /lib/modules/`uname -r` && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)', + 'stap --disable-cache -DSTP_NO_VERREL_CHECK /tmp/hello.stp' + ] + for cmd in cmds: + status, output = self.target.run(cmd, 900) + self.assertEqual(status, 0, msg='\n'.join([cmd, output])) diff --git a/meta/lib/oeqa/runtime/files/hello.stp b/meta/lib/oeqa/runtime/files/hello.stp new file mode 100644 index 0000000..3677147 --- /dev/null +++ b/meta/lib/oeqa/runtime/files/hello.stp @@ -0,0 +1 @@ +probe oneshot { println("hello world") }