summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-replace-python-with-python3-in-the-test.patch
blob: 44387165a8693744f2241b0200dd1bffdf14709e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 62319459e7ef14a37293bc10830b52edf89daabe Mon Sep 17 00:00:00 2001
From: Wentao Zhang <wentao.zhang@windriver.com>
Date: Tue, 15 Aug 2023 11:18:36 +0800
Subject: [PATCH 1/4] replace python with python3 in the test

"runtime:call" in ptest gets the following FAILED:
python: No such file or directory
replace python with python3 in the test scripts.

$export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin
$cd /usr/lib/bpftrace/ptest/tests
$python3 runtime/engine/main.py --filter="call.*"
***
[ RUN      ] call.strftime_microsecond_extension_rollover
[  FAILED  ] call.strftime_microsecond_extension_rollover
	Command: /usr/bin/bpftrace -e 'BEGIN { printf("%s - %s\n", strftime
    ("1%f", 1000000123000), strftime("1%f", 0)); exit(); }' | tail -n
    +2 | xargs -I{} python -c "print({})"
	Unclean exit code: 127
	Output: __BPFTRACE_NOTIFY_PROBES_ATTACHED\nxargs: python: No such
    file or directory\n
***

Upstream-Status: Submitted [https://github.com/bpftrace/bpftrace/pull/3009]

Signed-off-by: Wentao Zhang <wentao.zhang@windriver.com>
---
 tests/runtime/call | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/runtime/call b/tests/runtime/call
index 7f7cce6d..174bce95 100644
--- a/tests/runtime/call
+++ b/tests/runtime/call
@@ -371,13 +371,13 @@ TIMEOUT 5
 #
 # Note we add a `1` before the timestamp b/c leading zeros (eg `0123`) is invalid integer in python.
 NAME strftime_microsecond_extension
-RUN {{BPFTRACE}} -e 'BEGIN { printf("%s - %s\n", strftime("1%f", 1000123000), strftime("1%f", 0)); exit(); }' | tail -n +2 | xargs -I{} python -c "print({})"
+RUN {{BPFTRACE}} -e 'BEGIN { printf("%s - %s\n", strftime("1%f", 1000123000), strftime("1%f", 0)); exit(); }' | tail -n +2 | xargs -I{} python3 -c "print({})"
 EXPECT 123
 TIMEOUT 1
 
 # Similar to above test but test that rolling over past 1s works as expected
 NAME strftime_microsecond_extension_rollover
-RUN {{BPFTRACE}} -e 'BEGIN { printf("%s - %s\n", strftime("1%f", 1000000123000), strftime("1%f", 0)); exit(); }' | tail -n +2 | xargs -I{} python -c "print({})"
+RUN {{BPFTRACE}} -e 'BEGIN { printf("%s - %s\n", strftime("1%f", 1000000123000), strftime("1%f", 0)); exit(); }' | tail -n +2 | xargs -I{} python3 -c "print({})"
 EXPECT 123
 TIMEOUT 1
 
-- 
2.43.2