summaryrefslogtreecommitdiff
path: root/src/helpers/set_vyconf_backend.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2025-05-02 16:31:21 -0500
committerJohn Estabrook <jestabro@vyos.io>2025-05-22 13:26:48 -0500
commit48f9544c72386bccb177ae213c13d4f68053bc06 (patch)
tree53c567b18bd463611b8e399bfbd42ae058e01b15 /src/helpers/set_vyconf_backend.py
parent0686808c07e758bb3aa6d82d2482d4d972d83d71 (diff)
downloadvyos-1x-48f9544c72386bccb177ae213c13d4f68053bc06.tar.gz
vyos-1x-48f9544c72386bccb177ae213c13d4f68053bc06.zip
T7352: add util for enabling vyconf backend for smoketests
Diffstat (limited to 'src/helpers/set_vyconf_backend.py')
-rwxr-xr-xsrc/helpers/set_vyconf_backend.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/helpers/set_vyconf_backend.py b/src/helpers/set_vyconf_backend.py
new file mode 100755
index 000000000..6747e51c3
--- /dev/null
+++ b/src/helpers/set_vyconf_backend.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2025 VyOS maintainers and contributors
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or later as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+
+# N.B. only for use within testing framework; explicit invocation will leave
+# system in inconsistent state.
+
+from argparse import ArgumentParser
+
+from vyos.utils.backend import set_vyconf_backend
+
+
+parser = ArgumentParser()
+parser.add_argument('--disable', action='store_true',
+ help='enable/disable vyconf backend')
+parser.add_argument('--no-prompt', action='store_true',
+ help='confirm without prompt')
+
+args = parser.parse_args()
+
+match args.disable:
+ case False:
+ set_vyconf_backend(True, no_prompt=args.no_prompt)
+ case True:
+ set_vyconf_backend(False, no_prompt=args.no_prompt)