Skip to content
Snippets Groups Projects
Commit f4c1d448 authored by Anh Nguyen-Tuong's avatar Anh Nguyen-Tuong
Browse files

Add elfdep test

Former-commit-id: b98b5790a4fc33d31656bb7b8c8a8d9d9fe49a12
parent 01dcd78d
No related branches found
No related tags found
No related merge requests found
......@@ -145,3 +145,34 @@ xform-cat-centos75:
variables:
OS: 'centos75'
#
# elfdep test
#
# template
.elfdep: &elfdep
stage: test
script:
- ./cicd_tests/elfdep.sh
elfdep-ubuntu18:
<<: *elfdep
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
elfdep-ubuntu16:
<<: *elfdep
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
elfdep-centos75:
<<: *elfdep
tags:
- centos75
variables:
OS: 'centos75'
#!/bin/bash
set -e
set -x
cd $CICD_MODULE_WORK_DIR/peasoup_umbrella
source set_env_vars
cd $SECURITY_TRANSFORMS_HOME/libElfDep/test/
./test-elfdep.sh
#!/bin/bash
TMP_ORIG=/tmp/testelfdep.ls.orig.$$
TMP_ORIG2=/tmp/testelfdep.ls.orig.2.$$
TMP_ELFDEP=/tmp/testelfdep.ls.elfdep.$$
cleanup_files()
{
rm /tmp/testelfdep.ls* >/dev/null 2>&1
}
cleanup()
{
echo "************"
echo "test failed."
echo "************"
cleanup_files
exit 1
}
......@@ -14,8 +25,19 @@ scons || cleanup
$PSZ /bin/ls ./xxx -c move_globals=on -o move_globals:--elftables -c edt=on || cleanup
/bin/ls /tmp || cleanup
./xxx /tmp || cleanup
/bin/ls /tmp > $TMP_ORIG || cleanup
./xxx /tmp > $TMP_ELFDEP || cleanup
echo "Verify external vars was overwritten"
grep "var = 0" $TMP_ELFDEP || cleanup
grep "var = 1" $TMP_ELFDEP || cleanup
echo "Verify same output"
grep -v "var =" $TMP_ELFDEP > $TMP_ORIG2
diff $TMP_ORIG2 $TMP_ELFDEP
cleanup_files
echo
echo "test passed."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment