From b0aadc407c029b9a55777e182e37b5e934a2b792 Mon Sep 17 00:00:00 2001 From: Nayna Jain Date: Thu, 13 Aug 2020 19:23:52 +0000 Subject: [PATCH] programs/ssl: add EOF testcase for ssl_context_info.c This patch updates the test cases to also check for EOF correctly. Signed-off-by: Nayna Jain --- tests/context-info.sh | 7 ++++++- tests/data_files/base64/def_bad_b64_eof.txt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/data_files/base64/def_bad_b64_eof.txt diff --git a/tests/context-info.sh b/tests/context-info.sh index 344dd4ea93d0..742e2db1e8aa 100755 --- a/tests/context-info.sh +++ b/tests/context-info.sh @@ -400,7 +400,12 @@ run_test "Wrong base64 format" \ "def_bad_b64.txt" \ -m "ERROR" \ -u "The length of the base64 code found should be a multiple of 4" \ - -n "bytes left to analyze from context" + -n "bytes left to analyze from context" \ + +run_test "EOF base64 format" \ + "def_bad_b64_eof.txt" \ + -m "Finished. No valid base64 code found" \ + -n "ERROR" \ run_test "Too much data at the beginning of base64 code" \ "def_b64_too_big_1.txt" \ diff --git a/tests/data_files/base64/def_bad_b64_eof.txt b/tests/data_files/base64/def_bad_b64_eof.txt new file mode 100644 index 000000000000..59593b0534f4 --- /dev/null +++ b/tests/data_files/base64/def_bad_b64_eof.txt @@ -0,0 +1 @@ +/w==