Document tests
authornorly <ny-git@enpas.org>
Fri, 28 Jun 2013 16:04:55 +0000 (17:04 +0100)
committernorly <ny-git@enpas.org>
Mon, 23 Feb 2015 23:18:27 +0000 (00:18 +0100)
docs/tests.md [new file with mode: 0644]
tests/01-noop32.test
tests/02-noop64.test
tests/03-injection32.test
tests/04-injection64.test
tests/05-detour.test
tests/06-data64kb.test
tests/07-dynlink-globalvar.test
tests/99-data256mb.test

diff --git a/docs/tests.md b/docs/tests.md
new file mode 100644 (file)
index 0000000..b65fb66
--- /dev/null
@@ -0,0 +1,11 @@
+Automated testing
+=================
+
+centaur comes with a suite of automated tests. Run
+    make check
+in the top-level directory to build elfucli and run the tests.
+
+Temporary files will be created in tests/build/ and cleaned
+up on 'make clean'.
+
+See the test scripts themselves for more specific documentation.
index 145bae39139d1b1e02b5b2b387a3f84b7688593a..0192240e226b1d13ce959aff42fbc05213814615 100644 (file)
@@ -1,4 +1,8 @@
 #!/bin/sh
+
+# Test if elfu can clone a given x86-32 executable in the way expected
+# by comparing it to a reference output.
+
 source ./boilerplate.sh
 
 elfucli --input reference/putsmain32 \
index d519c550ac77dcc16967e9a5d85443c6e1c2dfc3..26b13282b23e4edaaf8c80b4f6c2a016afa03666 100644 (file)
@@ -1,4 +1,8 @@
 #!/bin/sh
+
+# Test if elfu can clone a given x86-64 executable in the way expected
+# by comparing it to a reference output.
+
 source ./boilerplate.sh
 
 elfucli --input reference/putsmain64 \
index 235f243f694498417e427fe356cc0b76b988d9ac..52405b632792a9375bae998bcd35281e681ebf20 100644 (file)
@@ -1,4 +1,9 @@
 #!/bin/sh
+
+# Test if elfu can inject a x86-32 object file into an x86-32
+# executable. Since both are given, we can compare the output to a
+# reference file.
+
 source ./boilerplate.sh
 
 elfucli --input reference/putsmain32 \
index 5ca6237384764ba0ba90f6355635edd14a77531d..145e817a20b3e90eacf8993e9f830583362e8d77 100644 (file)
@@ -1,4 +1,9 @@
 #!/bin/sh
+
+# Test if elfu can inject a x86-64 object file into an x86-64
+# executable. Since both are given, we can compare the output to a
+# reference file.
+
 source ./boilerplate.sh
 
 elfucli --input reference/putsmain64 \
index c46ef2f5ca4469a0205b6d1a322826c89435a076..a2d5d0677f7fdcaecb4b075ed2220c7863b62b99 100644 (file)
@@ -1,4 +1,11 @@
 #!/bin/sh
+
+# 1. Inject a freshly built object file into a fresh executable.
+#    Both use a dynamically loaded function.
+# 2. Detour execution from a function in the executable to a function
+#    originating from the object file.
+# 3. Check if the new executable prints the expected changed output.
+
 source ./boilerplate.sh
 
 elfucli --input $BUILDDIR/putsmainsub \
index ebeeff2de33f906f0095af4ecd42d9d5d5cabe18..dbb2c171184cd4f9d54c29457717e9bdf101f3a0 100644 (file)
@@ -1,4 +1,9 @@
 #!/bin/sh
+
+# 1. Inject a freshly built object file with a 64 KB data section into
+#    a fresh executable.
+# 2. Check if the new executable is still functional.
+
 source ./boilerplate.sh
 
 elfucli --input $BUILDDIR/putsmain \
index 34970f5056b48a72ce1e6153ccf95f902aefb943..227bc91962cd551f881dd49fc5ae096188b64ed4 100644 (file)
@@ -1,4 +1,11 @@
 #!/bin/sh
+
+# 1. Inject a freshly built object file into a fresh executable.
+#    Both use a dynamically loaded function and global variable.
+# 2. Detour execution from a function in the executable to a function
+#    originating from the object file.
+# 3. Check if the new executable prints the expected changed output.
+
 source ./boilerplate.sh
 
 elfucli --input $BUILDDIR/putsmainsubglobal \
index 55cfcd26c2e56bce0c3d2a3c73d66d6f0c05e487..e879840a7a54b0a0b253edd036acdf4fb51390c2 100644 (file)
@@ -1,4 +1,9 @@
 #!/bin/sh
+
+# 1. Inject a freshly built object file with a 256 MB data section
+#    into a fresh executable.
+# 2. Check if the new executable is still functional.
+
 source ./boilerplate.sh
 
 elfucli --input $BUILDDIR/putsmain \