From 1db196beea9bbb9e78ad42abcdc0a1754ca19eed Mon Sep 17 00:00:00 2001 From: Olivier Roques Date: Fri, 27 Jan 2023 08:24:18 +0000 Subject: feat(tests): add HMAC to functional tests Ref: HICN-833 Signed-off-by: Olivier Roques Change-Id: I40df138798f980f8a89e5fd13db54c2ac89f34b7 --- libtransport/includes/hicn/transport/auth/crypto_hash.h | 2 +- libtransport/src/auth/crypto_hash.cc | 2 +- tests/.env | 5 ++++- tests/2-nodes-hicn-light.yml | 2 +- tests/2-nodes-vpp-bridge.yml | 2 +- tests/2-nodes-vpp-memif-replication.yml | 2 +- tests/2-nodes-vpp-memif.yml | 2 +- tests/config.sh | 2 +- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libtransport/includes/hicn/transport/auth/crypto_hash.h b/libtransport/includes/hicn/transport/auth/crypto_hash.h index fbe1d5160..9535e07c7 100644 --- a/libtransport/includes/hicn/transport/auth/crypto_hash.h +++ b/libtransport/includes/hicn/transport/auth/crypto_hash.h @@ -40,7 +40,7 @@ class CryptoHash { // Constructors CryptoHash(); CryptoHash(const CryptoHash &other); - CryptoHash(CryptoHash &&other); + CryptoHash(CryptoHash &&other) noexcept; CryptoHash(CryptoHashType hash_type); CryptoHash(const uint8_t *hash, std::size_t size, CryptoHashType hash_type); CryptoHash(const std::vector &hash, CryptoHashType hash_type); diff --git a/libtransport/src/auth/crypto_hash.cc b/libtransport/src/auth/crypto_hash.cc index 0f6e9ab53..cf781d08e 100644 --- a/libtransport/src/auth/crypto_hash.cc +++ b/libtransport/src/auth/crypto_hash.cc @@ -27,7 +27,7 @@ CryptoHash::CryptoHash(const CryptoHash &other) digest_(other.digest_), digest_size_(other.digest_size_) {} -CryptoHash::CryptoHash(CryptoHash &&other) +CryptoHash::CryptoHash(CryptoHash &&other) noexcept : digest_type_(std::move(other.digest_type_)), digest_(std::move(other.digest_)), digest_size_(other.digest_size_) {} diff --git a/tests/.env b/tests/.env index 3eeee90c4..1e06ca0c8 100644 --- a/tests/.env +++ b/tests/.env @@ -9,12 +9,15 @@ TEST_VPP_MEMIF=vpp-memif TEST_VPP_MEMIF_REPLICATION=vpp-memif-replication TEST_VPP_MEMIF_LOCALREMOTE=vpp-memif-local-remote -# names +# Names RTC_PRODUCER=b002:0:0:0:abcd::/80 RAAQM_PRODUCER=b002::2 PING_PRODUCER=b002::3 RAAQM_PRODUCER_NEW=b002::4 +# Test keys +HMAC_KEY="hunter2" + # Log FORWARDER_LOG_PATH=/tmp/forwarder.log diff --git a/tests/2-nodes-hicn-light.yml b/tests/2-nodes-hicn-light.yml index 50b756f26..849432464 100644 --- a/tests/2-nodes-hicn-light.yml +++ b/tests/2-nodes-hicn-light.yml @@ -45,7 +45,7 @@ services: sleep 4 - hiperf -q -z hicnlight_module -S -R -B 4000kbps ${RTC_PRODUCER} -P 2 & + hiperf -q -z hicnlight_module -S -R -B 4000kbps ${RTC_PRODUCER} -P 2 -k ${HMAC_KEY} & hiperf -q -z hicnlight_module -S ${RAAQM_PRODUCER}/128 & hiperf -q -z hicnlight_module -S ${RAAQM_PRODUCER_NEW}/128 & hicn-ping-server -z hicnlight_module -s 0 -n ${PING_PRODUCER}/128 & diff --git a/tests/2-nodes-vpp-bridge.yml b/tests/2-nodes-vpp-bridge.yml index a64fe057a..e9d0cf809 100644 --- a/tests/2-nodes-vpp-bridge.yml +++ b/tests/2-nodes-vpp-bridge.yml @@ -105,7 +105,7 @@ services: sudo vpp -c /etc/vpp/startup.conf sleep 5 - sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 & + sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 -k ${HMAC_KEY} & sleep 1 sudo hiperf -q -S -z memif_module ${RAAQM_PRODUCER}/128 & sleep 1 diff --git a/tests/2-nodes-vpp-memif-replication.yml b/tests/2-nodes-vpp-memif-replication.yml index 68836902f..f74757aac 100644 --- a/tests/2-nodes-vpp-memif-replication.yml +++ b/tests/2-nodes-vpp-memif-replication.yml @@ -115,7 +115,7 @@ services: sudo vpp -c /etc/vpp/startup.conf sleep 10 - sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 & + sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 -k ${HMAC_KEY} & sleep 5 sudo hiperf -q -S -z memif_module ${RAAQM_PRODUCER}/128 & sleep 5 diff --git a/tests/2-nodes-vpp-memif.yml b/tests/2-nodes-vpp-memif.yml index 0472b8299..7240f8b2c 100644 --- a/tests/2-nodes-vpp-memif.yml +++ b/tests/2-nodes-vpp-memif.yml @@ -107,7 +107,7 @@ services: sudo vpp -c /etc/vpp/startup.conf sleep 10 - sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 & + sudo hiperf -q -S -R -B 4000kbps -z memif_module ${RTC_PRODUCER} -P 2 -k ${HMAC_KEY} & sleep 5 sudo hiperf -q -S -z memif_module ${RAAQM_PRODUCER}/128 & sleep 5 diff --git a/tests/config.sh b/tests/config.sh index 760de8b08..00d148e42 100755 --- a/tests/config.sh +++ b/tests/config.sh @@ -16,7 +16,7 @@ BUILD_SOFTWARE=${BUILD_SOFTWARE:-1} PRIVILEGED=${TEST_PRIVILEGED:-false} set +a -HIPERF_CMD_RTC="ENABLE_LOG_PREFIX=OFF /usr/bin/hiperf -q -n 50 -C -H -R ${RTC_PRODUCER} -P 2" +HIPERF_CMD_RTC="ENABLE_LOG_PREFIX=OFF /usr/bin/hiperf -q -n 50 -C -H -R ${RTC_PRODUCER} -P 2 -k ${HMAC_KEY}" HIPERF_CMD_MEMIF_RTC="${HIPERF_CMD_RTC} -z memif_module" POSTPROCESS_COMMAND_RAAQM_RTC='tail -n +3 | \ tr -s " " | \ -- cgit 1.2.3-korg