From cb3ca119d1ec57445ab900973e8ec85dab4c9291 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 8 Jan 2025 02:48:29 +0800 Subject: [PATCH] Create /etc/tacacs folder on PTF when it's missing (#16352) Create /etc/tacacs folder on PTF when it's missing Why I did it TACACS test failed because /etc/tacacs+ folder does not exist, which recently missing on some version of PTF container image. Error message: E msg = Destination directory /etc/tacacs+ does not exist How I did it Create /etc/tacacs folder on PTF when it's missing How to verify it Pass all test case. Description for the changelog Create /etc/tacacs folder on PTF when it's missing --- tests/common/helpers/tacacs/tacacs_helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/common/helpers/tacacs/tacacs_helper.py b/tests/common/helpers/tacacs/tacacs_helper.py index 2c696678260..66856ef82bf 100644 --- a/tests/common/helpers/tacacs/tacacs_helper.py +++ b/tests/common/helpers/tacacs/tacacs_helper.py @@ -177,6 +177,7 @@ def setup_tacacs_server(ptfhost, tacacs_creds, duthost): logger.debug("setup_tacacs_server: duthost options does not contains config for ansible_ssh_user.") ptfhost.host.options['variable_manager'].extra_vars.update(extra_vars) + ptfhost.shell("mkdir -p /etc/tacacs+") ptfhost.template(src="tacacs/tac_plus.conf.j2", dest="/etc/tacacs+/tac_plus.conf") # Find 'python' command symbolic link target, and fix the tac_plus config file