aboutsummaryrefslogtreecommitdiffstats
path: root/roms/skiboot/external/gard/test/tests
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/external/gard/test/tests
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/external/gard/test/tests')
-rw-r--r--roms/skiboot/external/gard/test/tests/00-list10
-rw-r--r--roms/skiboot/external/gard/test/tests/01-show_110
-rw-r--r--roms/skiboot/external/gard/test/tests/02-usage17
-rw-r--r--roms/skiboot/external/gard/test/tests/03-show_1-p910
-rw-r--r--roms/skiboot/external/gard/test/tests/04-create-bad-instance10
-rw-r--r--roms/skiboot/external/gard/test/tests/05-create-bad-unit10
-rw-r--r--roms/skiboot/external/gard/test/tests/06-create-long-path10
-rw-r--r--roms/skiboot/external/gard/test/tests/07-create-slash10
-rw-r--r--roms/skiboot/external/gard/test/tests/08-create-duplicate10
-rw-r--r--roms/skiboot/external/gard/test/tests/09-create-last-unit16
-rw-r--r--roms/skiboot/external/gard/test/tests/10-clear-single23
-rw-r--r--roms/skiboot/external/gard/test/tests/11-clear-first26
12 files changed, 162 insertions, 0 deletions
diff --git a/roms/skiboot/external/gard/test/tests/00-list b/roms/skiboot/external/gard/test/tests/00-list
new file mode 100644
index 000000000..982acb3d3
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/00-list
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -8 -f test/files/data1.bin list"
+if [ "$?" -ne 0 ] ; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/01-show_1 b/roms/skiboot/external/gard/test/tests/01-show_1
new file mode 100644
index 000000000..48b779eb9
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/01-show_1
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -8 -f test/files/data1.bin show 1"
+if [ "$?" -ne 0 ] ; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/02-usage b/roms/skiboot/external/gard/test/tests/02-usage
new file mode 100644
index 000000000..7ef3c04e6
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/02-usage
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# This test fails on FSP based system. Hence skip this test.
+if [ -d "/proc/device-tree/fsps" ] ; then
+ return 0
+fi
+
+run_binary "./opal-gard"
+if [ "$?" -ne 1 ] ; then
+ fail_test
+fi
+
+strip_version_from_result "gard"
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/03-show_1-p9 b/roms/skiboot/external/gard/test/tests/03-show_1-p9
new file mode 100644
index 000000000..2a7b91b7d
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/03-show_1-p9
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -f test/files/data-p9.bin --p9 show 1"
+if [ "$?" -ne 0 ] ; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/04-create-bad-instance b/roms/skiboot/external/gard/test/tests/04-create-bad-instance
new file mode 100644
index 000000000..f9070a3dc
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/04-create-bad-instance
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -8 -f test/files/blank.bin create /sys256"
+if [ "$?" -eq 0 ]; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/05-create-bad-unit b/roms/skiboot/external/gard/test/tests/05-create-bad-unit
new file mode 100644
index 000000000..be60aed04
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/05-create-bad-unit
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -f test/files/blank.bin create /doesnt_exist0"
+if [ "$?" -eq 0 ]; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/06-create-long-path b/roms/skiboot/external/gard/test/tests/06-create-long-path
new file mode 100644
index 000000000..f3ffaabf6
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/06-create-long-path
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -8 -f test/files/blank.bin create /sys0/sys0/sys0/sys0/sys0/sys0/sys0/sys0/sys0/sys0/sys0/sys0/"
+if [ "$?" -eq 0 ]; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/07-create-slash b/roms/skiboot/external/gard/test/tests/07-create-slash
new file mode 100644
index 000000000..0e597e346
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/07-create-slash
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -f test/files/blank.bin create /"
+if [ "$?" -eq 0 ]; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/08-create-duplicate b/roms/skiboot/external/gard/test/tests/08-create-duplicate
new file mode 100644
index 000000000..fad5d3499
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/08-create-duplicate
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+run_binary "./opal-gard" "-p -e -8 -f test/files/data1.bin create /Sys0/Node0/Membuf0"
+if [ "$?" -eq 0 ]; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/09-create-last-unit b/roms/skiboot/external/gard/test/tests/09-create-last-unit
new file mode 100644
index 000000000..4d9b319cc
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/09-create-last-unit
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+cp test/files/blank.bin $DATA_DIR/input
+run_binary "./opal-gard" "-9 -p -e -f $DATA_DIR/input create /MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255/MFREFCLK255"
+if [ "$?" -ne 0 ]; then
+ fail_test
+fi
+
+run_binary "./opal-gard" "-9 -p -e -f $DATA_DIR/input list"
+if [ "$?" -ne 0 ]; then
+ fail_test
+fi
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/10-clear-single b/roms/skiboot/external/gard/test/tests/10-clear-single
new file mode 100644
index 000000000..3a5f962ec
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/10-clear-single
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+DATA=$(mktemp)
+
+cleanup() {
+ rm -f $DATA
+}
+
+trap cleanup EXIT
+
+dd if=/dev/zero of=$DATA bs=$((0x1000)) count=5 2>/dev/null
+
+run_binary "./opal-gard" "-p -e -f $DATA clear all"
+run_binary "./opal-gard" "-p -e -f $DATA create /sys0/node0/proc1"
+run_binary "./opal-gard" "-p -e -f $DATA list"
+run_binary "./opal-gard" "-p -e -f $DATA clear 00000001"
+run_binary "./opal-gard" "-p -e -f $DATA list"
+
+diff_with_result
+
+pass_test
diff --git a/roms/skiboot/external/gard/test/tests/11-clear-first b/roms/skiboot/external/gard/test/tests/11-clear-first
new file mode 100644
index 000000000..c59fcc8f0
--- /dev/null
+++ b/roms/skiboot/external/gard/test/tests/11-clear-first
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+DATA=$(mktemp)
+
+cleanup() {
+ rm -f $DATA
+}
+
+trap cleanup EXIT
+
+dd if=/dev/zero of=$DATA bs=$((0x1000)) count=5 2>/dev/null
+
+run_binary "./opal-gard" "-p -e -f $DATA clear all"
+run_binary "./opal-gard" "-p -e -f $DATA create /sys0/node0/proc0"
+run_binary "./opal-gard" "-p -e -f $DATA create /sys0/node0/proc1"
+run_binary "./opal-gard" "-p -e -f $DATA list"
+run_binary "./opal-gard" "-p -e -f $DATA clear 00000001"
+run_binary "./opal-gard" "-p -e -f $DATA list"
+run_binary "./opal-gard" "-p -e -f $DATA clear 00000002"
+run_binary "./opal-gard" "-p -e -f $DATA list"
+
+diff_with_result
+
+pass_test