Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
b91cdd1f
Commit
b91cdd1f
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
Run both orig and xformed binary from the same path
Former-commit-id: 99b2dbf7378c3d20943516317147fe4361becad1
parent
9ec52a09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/manual_test_lib.sh
+22
-20
22 additions, 20 deletions
tests/manual_test_lib.sh
tests/tcpdump/test_script.sh
+2
-31
2 additions, 31 deletions
tests/tcpdump/test_script.sh
tests/test_cmds.sh
+11
-0
11 additions, 0 deletions
tests/test_cmds.sh
with
35 additions
and
51 deletions
tests/manual_test_lib.sh
+
22
−
20
View file @
b91cdd1f
...
...
@@ -31,22 +31,29 @@ if [[ ! -z "$IGNORE_RESULTS" ]]; then
echo
"TEST SCRIPT COVERAGE RUN: running test script ignoring results."
fi
TEST_PROG
=
$1
BENCH
=
$2
TEST_PROG
=
$(
realpath
$1
)
BENCH
=
$(
realpath
$2
)
DUMMY_NAME
=
DUMMY
TEST_BASE
=
`
basename
$TEST_PROG
`
BENCH_BASE
=
`
basename
$BENCH
`
SCRATCH_DIR
=
"
$(
dirname
$BENCH
)
"
TEST_PROG_ORIG
=
$SCRATCH_DIR
/
$TEST_BASE
.orig
BENCH_ORIG
=
$SCRATCH_DIR
/
$BENCH_BASE
.xform
CANONICAL
=
$SCRATCH_DIR
/
$TEST_BASE
cp
$TEST_PROG
$TEST_PROG_ORIG
cp
$BENCH
$BENCH_ORIG
if
[
!
-z
"
$TEST_VERBOSE
"
]
;
then
echo
echo
"Original program:
$TEST_PROG
"
ls
-lt
$TEST_PROG
echo
"Test program:
$BENCH
"
ls
-lt
$BENCH
echo
"Original program:
$TEST_PROG
-->
$TEST_PROG_ORIG
"
echo
"Test program:
$BENCH
-->
$BENCH_ORIG
"
echo
"Canonical program:
$CANONICAL
"
echo
fi
DUMMY_NAME
=
DUMMY
BENCH_BASE
=
`
basename
$BENCH
`
TEST_BASE
=
`
basename
$TEST_PROG
`
NAME_REGEX
=
`
echo
"(
$BENCH_BASE
\|
$TEST_BASE
\|
$ORIG_NAME
\|
.peasoup
\|
.ncexe
\|
.stratafied)"
|
sed
's/\./\\\./'
`
...
...
@@ -125,14 +132,12 @@ log_results()
run_test_prog_only
()
{
echo
echo
"=== RUN TRANSFORMED PROGRAM ==="
set
-x
ls
-lt
*
out
*
error
TIMEOUT
=
$1
shift
cp
$TEST_PROG_ORIG
$CANONICAL
TEST_PROG
=
$CANONICAL
cmd_args
=
"
$@
"
if
[[
"
$TEST_PROG
"
==
""
]]
;
then
...
...
@@ -225,11 +230,8 @@ run_server_test_prog_only()
run_bench_prog_only
()
{
echo
echo
"=== RUN ORIGINAL PROGRAM ==="
set
-x
ls
-lt
*
out
*
error
cp
$BENCH_ORIG
$CANONICAL
BENCH
=
$CANONICAL
TIMEOUT
=
$1
shift
...
...
This diff is collapsed.
Click to expand it.
tests/tcpdump/test_script.sh
+
2
−
31
View file @
b91cdd1f
#!/bin/bash
set
-x
TEST_DIR
=
$PEASOUP_HOME
/tests/tcpdump
TEST_LIB
=
"
$TEST_DIR
/../manual_test_lib.sh"
echo
"TEST_DIR:
$TEST_DIR
"
TEST_LIB
=
"
$(
realpath
"
$TEST_DIR
/../manual_test_lib.sh"
)
"
#used for filtering program names from output.
ORIG_NAME
=
tcpdump
ls
-lt
$TEST_DIR
|
grep
tcpd_tests
pwd
whoami
sudo chmod
-R
og+rwx
"
$TEST_DIR
/tcpd_tests"
ls
-lt
$TEST_DIR
ls
-lt
$TEST_DIR
/tcpd_tests
ls
-lt
"
$TEST_DIR
/tcpd_tests/*.pcap"
#must import the library here, as it depends on some of the above variables
.
$TEST_LIB
DELETE_FILTER
=
"stonesoup|gcc|lib|DUMMY|exec|python|tcpdump"
# debugging
echo
echo
"STRACE
$1
"
strace
$1
-n
-r
$TEST_DIR
/tcpd_tests/bgp_vpn_attrset.pcap
-t
-v
if
[
!
$?
-eq
0
]
;
then
report_failure
fi
echo
echo
"STRACE
$2
"
strace
$2
-n
-r
$TEST_DIR
/tcpd_tests/bgp_vpn_attrset.pcap
-t
-v
if
[
!
$?
-eq
0
]
;
then
tail
-n
30 /var/log/syslog
report_failure
fi
run_basic_test 20
-n
-r
$TEST_DIR
/tcpd_tests/bgp_vpn_attrset.pcap
-t
-v
run_basic_test 20
-h
run_basic_test 20
-n
-r
$TEST_DIR
/tcpd_tests/bgp_vpn_attrset.pcap
-t
-v
run_basic_test 20 -
$i
-s0
-nr
$TEST_DIR
/tcpd_tests/print-flags.pcap
run_basic_test 20
-n
-r
$TEST_DIR
/tcpd_tests/mpbgp-linklocal-nexthop.pcap
-t
-v
run_basic_test 20
-n
-r
$TEST_DIR
/tcpd_tests/eapon1.pcap
-t
...
...
This diff is collapsed.
Click to expand it.
tests/test_cmds.sh
+
11
−
0
View file @
b91cdd1f
...
...
@@ -162,6 +162,15 @@ do_tests()
orig
)
cp
$progpath
$protected
;;
fail
)
set
-x
base_prog
=
$(
basename
$progpath
)
if
[
$base_prog
=
"ls"
]
;
then
cp
$(
which diff
)
$protected
else
cp
$(
which
ls
)
$protected
fi
;;
*
)
echo
"Unknown configuration requested"
continue
...
...
@@ -226,6 +235,8 @@ usage()
echo
echo
"config:"
echo
" rida (default configuration)"
echo
" orig test against self"
echo
" fail deliberately induce failure"
echo
" p1 P1 transform"
echo
" mgx move globals"
echo
" mgx_p1 move globals, followed by P1"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment