From 837fb0ee7f44198f3735ce6f63c40c29dd4e2708 Mon Sep 17 00:00:00 2001 From: Ahmed Karic Date: Fri, 23 Aug 2024 11:11:27 +0200 Subject: [PATCH] confd: load test-config when in test-mode --- src/confd/bin/load | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/confd/bin/load b/src/confd/bin/load index df19130b..2c6722ee 100755 --- a/src/confd/bin/load +++ b/src/confd/bin/load @@ -1,5 +1,5 @@ #!/bin/sh -# load [-b] +# load [-b] # # Import a configuration to the sysrepo datastore using `sysrepocfg -Ifile` # @@ -41,6 +41,17 @@ err() . /etc/confdrc config=$1 + +if [ -f "/mnt/aux/test-mode" ] && [ "$config" = "startup-config" ]; then + + if [ -f "/mnt/aux/test-override-startup" ]; then + rm -f "/mnt/aux/test-override-startup" + else + note "Test mode detected, switching to test-config" + config="test-config" + fi +fi + if [ -f "$config" ]; then fn="$config" else