From 3a2051ace0a76cc76411b58702c105f705b744fc Mon Sep 17 00:00:00 2001
From: Matthew McGill <mm8bx@mega-techx41.maas>
Date: Sun, 3 Feb 2019 14:34:00 +0000
Subject: [PATCH] Changed cicd test structure

Former-commit-id: 23475a5b59f48d3c0d435dde1c8cf37fbd8d8187
---
 cicd_tests/cfi_smokescreen_configs.sh         | 64 -------------------
 cicd_tests/test_fib.sh                        |  4 +-
 cicd_tests/test_foo.sh                        |  4 +-
 .../tests/cicd_tests/fib_src}/fib.c           |  0
 .../tests/cicd_tests/fib_src}/libfib.c        |  0
 .../tests/cicd_tests/fib_src}/libfib2.c       |  0
 .../tests/cicd_tests/foo_src}/foo.c           |  0
 .../tests/cicd_tests/foo_src}/libfoo.c        |  0
 .../tests/{ => manual_tests}/dude.c           |  0
 .../tests/{ => manual_tests}/fib.c            |  0
 .../tests/{ => manual_tests}/foo.c            |  0
 .../tests/{ => manual_tests}/libc_driver.c    |  0
 .../tests/{ => manual_tests}/libdude.c        |  0
 .../tests/{ => manual_tests}/libfib.c         |  0
 .../tests/{ => manual_tests}/libfib2.c        |  0
 .../tests/{ => manual_tests}/libfoo.c         |  0
 .../tests/{ => manual_tests}/pow.c            |  0
 .../{ => manual_tests}/test_coreutils.sh      |  0
 .../tests/{ => manual_tests}/test_dude.sh     |  2 +-
 .../tests/{ => manual_tests}/test_fib.sh      |  2 +-
 .../tests/{ => manual_tests}/test_foo.sh      |  2 +-
 .../tests/{ => manual_tests}/test_libc.sh     |  2 +-
 .../tests/{ => manual_tests}/test_pow.sh      |  2 +-
 .../tests/{ => manual_tests}/test_spec.sh     |  0
 24 files changed, 9 insertions(+), 73 deletions(-)
 delete mode 100644 cicd_tests/cfi_smokescreen_configs.sh
 rename {cicd_tests => tools/selective_cfi/tests/cicd_tests/fib_src}/fib.c (100%)
 rename {cicd_tests => tools/selective_cfi/tests/cicd_tests/fib_src}/libfib.c (100%)
 rename {cicd_tests => tools/selective_cfi/tests/cicd_tests/fib_src}/libfib2.c (100%)
 rename {cicd_tests => tools/selective_cfi/tests/cicd_tests/foo_src}/foo.c (100%)
 rename {cicd_tests => tools/selective_cfi/tests/cicd_tests/foo_src}/libfoo.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/dude.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/fib.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/foo.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/libc_driver.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/libdude.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/libfib.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/libfib2.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/libfoo.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/pow.c (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_coreutils.sh (100%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_dude.sh (98%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_fib.sh (98%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_foo.sh (98%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_libc.sh (98%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_pow.sh (98%)
 rename tools/selective_cfi/tests/{ => manual_tests}/test_spec.sh (100%)

diff --git a/cicd_tests/cfi_smokescreen_configs.sh b/cicd_tests/cfi_smokescreen_configs.sh
deleted file mode 100644
index 8b5d6d2e6..000000000
--- a/cicd_tests/cfi_smokescreen_configs.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/bash
-
-
-configs=(do_cfi_4_byte 
-	 do_coloring_cfi_4_byte 
-	 do_cfi_exe_nonces_1_byte
-	 do_cfi_exe_nonces
-	 do_cfi_exe_nonces_4_byte_non_exe_color_non_exe
-	 do_cfi_exe_nonces_8_byte
-	 do_cfi_exe_nonces_1_byte_color_exe
-	 do_cfi_exe_nonces_color_exe
-	 do_cfi_exe_nonces_8_byte_color_exe
-	 do_cfi_exe_nonces_4_byte_non_exe_color_both)
-
-
-do_cfi_4_byte()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" --step-option selective_cfi:"--nonce-size 4"
-}
-
-do_coloring_cfi_4_byte()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" --step-option selective_cfi:"--nonce-size 4"
-}
-
-do_cfi_exe_nonces_1_byte()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:"--exe-nonce-size 1"
-}
-
-do_cfi_exe_nonces()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false"
-}
-
-do_cfi_exe_nonces_4_byte_non_exe_color_non_exe()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:"--nonce-size 4" --step-option selective_cfi:--color
-}
-
-do_cfi_exe_nonces_8_byte()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:"--exe-nonce-size 8"
-}
-
-do_cfi_exe_nonces_1_byte_color_exe()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:"--exe-nonce-size 1" --step-option selective_cfi:--color-exe-nonces
-}
-
-do_cfi_exe_nonces_color_exe()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:--color-exe-nonces
-}
-
-do_cfi_exe_nonces_8_byte_color_exe()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:"--exe-nonce-size 8" --step-option selective_cfi:--color-exe-nonces
-}
-
-do_cfi_exe_nonces_4_byte_non_exe_color_both()
-{
-        $PS $1 $2 --backend zipr --critical-step move_globals=on --critical-step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only  --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" --step-option selective_cfi:"--nonce-size 4" --step-option selective_cfi:--color-exe-nonces --step-option selective_cfi:--color
-}
diff --git a/cicd_tests/test_fib.sh b/cicd_tests/test_fib.sh
index 8fdee2662..1b8c4ddec 100755
--- a/cicd_tests/test_fib.sh
+++ b/cicd_tests/test_fib.sh
@@ -6,9 +6,9 @@ trap clean EXIT
 
 cd $CICD_MODULE_WORK_DIR/peasoup_umbrella
 source set_env_vars
-cd ./security_transforms/cicd_tests
+cd ./security_transforms/tools/selective_cfi/tests/cicd_tests/fib_src
 
-source cfi_smokescreen_configs.sh
+source ../cfi_smokescreen_configs.sh
 
 get_correct()
 {
diff --git a/cicd_tests/test_foo.sh b/cicd_tests/test_foo.sh
index e9162cf01..1e98e9d22 100755
--- a/cicd_tests/test_foo.sh
+++ b/cicd_tests/test_foo.sh
@@ -6,9 +6,9 @@ trap clean EXIT
 
 cd $CICD_MODULE_WORK_DIR/peasoup_umbrella
 source set_env_vars
-cd ./security_transforms/cicd_tests
+cd ./security_transforms/tools/selective_cfi/tests/cicd_tests/foo_src
 
-source cfi_smokescreen_configs.sh 
+source ../cfi_smokescreen_configs.sh 
 
 get_correct()
 {
diff --git a/cicd_tests/fib.c b/tools/selective_cfi/tests/cicd_tests/fib_src/fib.c
similarity index 100%
rename from cicd_tests/fib.c
rename to tools/selective_cfi/tests/cicd_tests/fib_src/fib.c
diff --git a/cicd_tests/libfib.c b/tools/selective_cfi/tests/cicd_tests/fib_src/libfib.c
similarity index 100%
rename from cicd_tests/libfib.c
rename to tools/selective_cfi/tests/cicd_tests/fib_src/libfib.c
diff --git a/cicd_tests/libfib2.c b/tools/selective_cfi/tests/cicd_tests/fib_src/libfib2.c
similarity index 100%
rename from cicd_tests/libfib2.c
rename to tools/selective_cfi/tests/cicd_tests/fib_src/libfib2.c
diff --git a/cicd_tests/foo.c b/tools/selective_cfi/tests/cicd_tests/foo_src/foo.c
similarity index 100%
rename from cicd_tests/foo.c
rename to tools/selective_cfi/tests/cicd_tests/foo_src/foo.c
diff --git a/cicd_tests/libfoo.c b/tools/selective_cfi/tests/cicd_tests/foo_src/libfoo.c
similarity index 100%
rename from cicd_tests/libfoo.c
rename to tools/selective_cfi/tests/cicd_tests/foo_src/libfoo.c
diff --git a/tools/selective_cfi/tests/dude.c b/tools/selective_cfi/tests/manual_tests/dude.c
similarity index 100%
rename from tools/selective_cfi/tests/dude.c
rename to tools/selective_cfi/tests/manual_tests/dude.c
diff --git a/tools/selective_cfi/tests/fib.c b/tools/selective_cfi/tests/manual_tests/fib.c
similarity index 100%
rename from tools/selective_cfi/tests/fib.c
rename to tools/selective_cfi/tests/manual_tests/fib.c
diff --git a/tools/selective_cfi/tests/foo.c b/tools/selective_cfi/tests/manual_tests/foo.c
similarity index 100%
rename from tools/selective_cfi/tests/foo.c
rename to tools/selective_cfi/tests/manual_tests/foo.c
diff --git a/tools/selective_cfi/tests/libc_driver.c b/tools/selective_cfi/tests/manual_tests/libc_driver.c
similarity index 100%
rename from tools/selective_cfi/tests/libc_driver.c
rename to tools/selective_cfi/tests/manual_tests/libc_driver.c
diff --git a/tools/selective_cfi/tests/libdude.c b/tools/selective_cfi/tests/manual_tests/libdude.c
similarity index 100%
rename from tools/selective_cfi/tests/libdude.c
rename to tools/selective_cfi/tests/manual_tests/libdude.c
diff --git a/tools/selective_cfi/tests/libfib.c b/tools/selective_cfi/tests/manual_tests/libfib.c
similarity index 100%
rename from tools/selective_cfi/tests/libfib.c
rename to tools/selective_cfi/tests/manual_tests/libfib.c
diff --git a/tools/selective_cfi/tests/libfib2.c b/tools/selective_cfi/tests/manual_tests/libfib2.c
similarity index 100%
rename from tools/selective_cfi/tests/libfib2.c
rename to tools/selective_cfi/tests/manual_tests/libfib2.c
diff --git a/tools/selective_cfi/tests/libfoo.c b/tools/selective_cfi/tests/manual_tests/libfoo.c
similarity index 100%
rename from tools/selective_cfi/tests/libfoo.c
rename to tools/selective_cfi/tests/manual_tests/libfoo.c
diff --git a/tools/selective_cfi/tests/pow.c b/tools/selective_cfi/tests/manual_tests/pow.c
similarity index 100%
rename from tools/selective_cfi/tests/pow.c
rename to tools/selective_cfi/tests/manual_tests/pow.c
diff --git a/tools/selective_cfi/tests/test_coreutils.sh b/tools/selective_cfi/tests/manual_tests/test_coreutils.sh
similarity index 100%
rename from tools/selective_cfi/tests/test_coreutils.sh
rename to tools/selective_cfi/tests/manual_tests/test_coreutils.sh
diff --git a/tools/selective_cfi/tests/test_dude.sh b/tools/selective_cfi/tests/manual_tests/test_dude.sh
similarity index 98%
rename from tools/selective_cfi/tests/test_dude.sh
rename to tools/selective_cfi/tests/manual_tests/test_dude.sh
index d873f0ff0..1f9882df0 100755
--- a/tools/selective_cfi/tests/test_dude.sh
+++ b/tools/selective_cfi/tests/manual_tests/test_dude.sh
@@ -1,6 +1,6 @@
 #!/bin/bash  
 
-source cfi_all_configs.sh
+source ../cfi_all_configs.sh
 
 get_correct()
 {
diff --git a/tools/selective_cfi/tests/test_fib.sh b/tools/selective_cfi/tests/manual_tests/test_fib.sh
similarity index 98%
rename from tools/selective_cfi/tests/test_fib.sh
rename to tools/selective_cfi/tests/manual_tests/test_fib.sh
index 4cb29073d..0bd770d5f 100755
--- a/tools/selective_cfi/tests/test_fib.sh
+++ b/tools/selective_cfi/tests/manual_tests/test_fib.sh
@@ -1,6 +1,6 @@
 #!/bin/bash  
 
-source cfi_all_configs.sh
+source ../cfi_smokescreen_configs.sh
 
 get_correct()
 {
diff --git a/tools/selective_cfi/tests/test_foo.sh b/tools/selective_cfi/tests/manual_tests/test_foo.sh
similarity index 98%
rename from tools/selective_cfi/tests/test_foo.sh
rename to tools/selective_cfi/tests/manual_tests/test_foo.sh
index 5f0cd9aeb..e0ae9c8dd 100755
--- a/tools/selective_cfi/tests/test_foo.sh
+++ b/tools/selective_cfi/tests/manual_tests/test_foo.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-source cfi_smokescreen_configs.sh 
+source ../cfi_smokescreen_configs.sh 
 
 get_correct()
 {
diff --git a/tools/selective_cfi/tests/test_libc.sh b/tools/selective_cfi/tests/manual_tests/test_libc.sh
similarity index 98%
rename from tools/selective_cfi/tests/test_libc.sh
rename to tools/selective_cfi/tests/manual_tests/test_libc.sh
index 52638634e..8c50b1a60 100755
--- a/tools/selective_cfi/tests/test_libc.sh
+++ b/tools/selective_cfi/tests/manual_tests/test_libc.sh
@@ -3,7 +3,7 @@
 libcpath=""
 
 
-source cfi_all_configs.sh
+source ../cfi_all_configs.sh
 
 
 get_correct()
diff --git a/tools/selective_cfi/tests/test_pow.sh b/tools/selective_cfi/tests/manual_tests/test_pow.sh
similarity index 98%
rename from tools/selective_cfi/tests/test_pow.sh
rename to tools/selective_cfi/tests/manual_tests/test_pow.sh
index 18bc4e389..0f8c6465c 100755
--- a/tools/selective_cfi/tests/test_pow.sh
+++ b/tools/selective_cfi/tests/manual_tests/test_pow.sh
@@ -1,7 +1,7 @@
 #!/bin/bash 
 
 
-source cfi_all_configs.sh
+source ../cfi_all_configs.sh
 
 
 get_correct()
diff --git a/tools/selective_cfi/tests/test_spec.sh b/tools/selective_cfi/tests/manual_tests/test_spec.sh
similarity index 100%
rename from tools/selective_cfi/tests/test_spec.sh
rename to tools/selective_cfi/tests/manual_tests/test_spec.sh
-- 
GitLab