support/testing: fix hardening tests
authorRicardo Martincoski <ricardo.martincoski@gmail.com>
Mon, 5 Aug 2019 01:20:50 +0000 (22:20 -0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 5 Aug 2019 20:15:18 +0000 (22:15 +0200)
commit5c39c90ae1968492ef565fe9afbe639cc38e9a69
tree5250bc5e306000eef12de3fa88769244f4bacdbd
parent5e45febb58d645de8875b9ad6bf964b0472555fa
support/testing: fix hardening tests

Since "2467822c85 package/checksec: bump to version 2.1.0" the hardening
tests fail because upstream slightly changed the way the script is
called.
According to README.md: "- All options now require `--$option=$value`
instead of `--$option $value`"

Instead of just replacing '--output json' with '--output=json' take into
account that upstream also changed the usage example to show --format
instead of --output. Both options do exactly the same, but following the
usage example seems to be more future-proof.

Upstream also improved the json output. Now when a file is passed as
parameter, the json has the file name as the main key, instead of the
string "file". Adjust the test cases accordingly.

Fixes:
tests.core.test_hardening.TestFortifyConserv
tests.core.test_hardening.TestFortifyNone
tests.core.test_hardening.TestRelro
tests.core.test_hardening.TestRelroPartial
tests.core.test_hardening.TestSspNone
tests.core.test_hardening.TestSspStrong

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Matt Weber <matthew.weber@rockwellcollins.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/testing/tests/core/test_hardening.py