Re: [PATCH v8 1/2] ima-evm-utils: Add some tests for evmctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/30/20 9:16 AM, Lakshmi Ramasubramanian wrote:

On 3/26/20 9:25 PM, Vitaly Chikunov wrote:

Run `make check' to execute the tests.

autogen.sh followed by configure need to be run. Could you please add that in the patch description?

diff --git a/tests/functions.sh b/tests/functions.sh
new file mode 100755
index 0000000..16c8d89
--- /dev/null
+++ b/tests/functions.sh
@@ -0,0 +1,272 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0

In some source files in the kernel repo I have seen the following:

     // SPDX-License-Identifier: GPL-2.0+

Not sure if it is applicable here.

+check() {
+  local alg=$1 pref=$2 chash=$3 hash
+  local file=$alg-hash.txt
+
+  rm -f $file
+  touch $file
+  # Generate hash with openssl, if it's failed skip test,

"if it failed skip test"

+  # unless it's negative test, then pass to evmctl
+  cmd="openssl dgst $OPENSSL_ENGINE -$alg $file"
+}
+

+# check args: algo hdr-prefix canonic-hash
+expect_pass check  md4        0x01 31d6cfe0d16ae931b73c59d7e0c089c0
+expect_pass check  md5        0x01 d41d8cd98f00b204e9800998ecf8427e
Is MD4 and MD5 tests still needed?


  -lakshmi

+ Mimi and linux-integrity



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux