Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
8f412d28
Commit
8f412d28
authored
Mar 31, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcc-lua: Add test for standalone `bcc-lua`
parent
3e81d3ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
tests/lua/CMakeLists.txt
tests/lua/CMakeLists.txt
+3
-0
tests/lua/test_standalone.sh
tests/lua/test_standalone.sh
+45
-0
No files found.
tests/lua/CMakeLists.txt
View file @
8f412d28
...
...
@@ -9,4 +9,7 @@ if(LUAJIT)
add_test
(
NAME lua_test_dump WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMMAND
${
TEST_WRAPPER
}
lua_test_dump sudo
${
LUAJIT
}
test_dump.lua
)
add_test
(
NAME lua_test_standalone WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
COMMAND
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_standalone.sh
)
endif
()
tests/lua/test_standalone.sh
0 → 100755
View file @
8f412d28
#!/bin/bash
# Copyright (c) GitHub, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
set
-xe
cd
"src/lua"
function
fail
{
echo
"test failed:
$1
"
>
&2
exit
1
}
if
[[
!
-x
bcc-lua
]]
;
then
echo
"bcc-lua not built --- skipping"
exit
0
fi
if
ldd bcc-lua |
grep
-q
luajit
;
then
fail
"bcc-lua depends on libluajit"
fi
rm
-f
libbcc.so probe.lua
echo
"return function(BPF) print(
\"
Hello world
\"
) end"
>
probe.lua
if
./bcc-lua
"probe.lua"
;
then
fail
"bcc-lua runs without libbcc.so"
fi
if
!
env
LIBBCC_SO_PATH
=
../cc/libbcc.so ./bcc-lua
"probe.lua"
;
then
fail
"bcc-lua cannot load libbcc.so through the environment"
fi
ln
-s
../cc/libbcc.so
if
!
./bcc-lua
"probe.lua"
;
then
fail
"bcc-lua cannot find local libbcc.so"
fi
PROBE
=
"../../../examples/lua/offcputime.lua"
if
!
sudo
./bcc-lua
"
$PROBE
"
-d
1
>
/dev/null 2>/dev/null
;
then
fail
"bcc-lua cannot run complex probes"
fi
rm
-f
libbcc.so probe.lua
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment