From efacdd45b0e16efad3c17516433d9c9f386e6afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o-Paul=20Bodin?= Date: Mon, 3 Nov 2025 18:29:00 +0100 Subject: [PATCH] ci: cram: new test development for tr181-security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add tests for CABundle references: PCF-1940 Signed-off-by: Théo-Paul Bodin --- .../020-security.t | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t b/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t index d6f2223d5f..e98a0c5ad5 100644 --- a/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t +++ b/.gitlab/tests/cram/generic/acceleration-plan-components/020-security.t @@ -80,8 +80,49 @@ Check that the first certificate is not present anymore: ecdsa-with-SHA512 true +Check that CABundle are presents: + + $ R "echo '%populate{object Security{object CABundle{instance add(){parameter Enable=1; parameter Name=cram; parameter CAFileURI=\"/tmp/server-cert.crt\";}}}}' > /etc/amx/tr181-security/extensions/01_cram_periodic_transfer.odl" ; sleep 1 + $ R '/etc/init.d/tr181-security restart' + $ R 'ba-cli Security.CABundleNumberOfEntries?' | grep -v '>' + Security.CABundleNumberOfEntries=1 + + +Check CABundle RPC: + + $ R "ba-cli 'Security.CABundle.1.CAFile()'" | grep -v '>' + Security.CABundle.1.CAFile() returned + [ + "", + { + CAFile = "/tmp/server-cert.crt" + } + ] + + $ R "ba-cli 'Security.CABundle.1.CADir()'" | grep -v '>' + Security.CABundle.1.CADir() returned + [ + "", + { + CADir = "" + } + ] + + $ R "ba-cli 'Security.CABundle.1.CADirURI=/tmp'" >/dev/null + $ R "ba-cli 'Security.CABundle.1.CADir()'" | grep -v '>' + Security.CABundle.1.CADir() returned + [ + "", + { + CADir = "/tmp" + } + ] + + Restore the state of the system: + $ R 'rm -rf /etc/amx/tr181-security/extensions/01_cram_periodic_transfer.odl' + $ R '/etc/init.d/tr181-security restart' $ R "rm -rf /etc/config/autocert" $ R "mv /etc/config/autocert.bak /etc/config/autocert" $ R "rm -rf /usr/share/ca-certificates"