diff --git a/docs/testplan/MACsec-test-plan.md b/docs/testplan/MACsec-test-plan.md index 721f5007633..11bfedddeb5 100644 --- a/docs/testplan/MACsec-test-plan.md +++ b/docs/testplan/MACsec-test-plan.md @@ -33,6 +33,7 @@ - [Config reload done on DUT with macsec configuration](#config-reload-done-on-dut-with-macsec-configuration) - [Everflow, port mirroring on macsec enabled interfaces](#everflow-port-mirroring-on-macsec-enabled-interfaces) - [Testcase : Macsec scenario's for multi-asic, multi-dut](#testcase--macsec-scenarios-for-multi-asic-multi-dut) + - [Testcase : Macsec docker restart](#testcase--macsec-docker-restart) - [Testcase : Scale tests](#testcase--scale-tests) - [Large number of interfaces having macsec enabled on the DUT/linecard](#large-number-of-interfaces-having-macsec-enabled-on-the-dutlinecard) - [Simultaneous rekeying in all macsec sessions](#simultaneous-rekeying-in-all-macsec-sessions) @@ -488,6 +489,11 @@ The switch should only react encrypted PFC frames, send encrypted PFC frames. - Verify macsec packet flow where the Ingress and Egress ports are on different Linecards. - TODO add expected behavior +### Testcase : Macsec docker restart + +- Verify that macsec sessions are restored when macsec docker containers are restarted + + ### Testcase : Scale tests #### Large number of interfaces having macsec enabled on the DUT/linecard diff --git a/tests/macsec/test_docker_restart.py b/tests/macsec/test_docker_restart.py new file mode 100644 index 00000000000..a4fa0bd6664 --- /dev/null +++ b/tests/macsec/test_docker_restart.py @@ -0,0 +1,22 @@ +import pytest +import logging + +from tests.common.utilities import wait_until +from .macsec_helper import check_appl_db + +logger = logging.getLogger(__name__) + +pytestmark = [ + pytest.mark.macsec_required, + pytest.mark.topology('t2') +] + + +def test_restart_macsec_docker(duthosts, ctrl_links, policy, cipher_suite, send_sci, + enum_rand_one_per_hwsku_frontend_hostname): + duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname] + + logger.info(duthost.shell(cmd="docker ps", module_ignore_errors=True)['stdout']) + duthost.restart_service("macsec") + logger.info(duthost.shell(cmd="docker ps", module_ignore_errors=True)['stdout']) + assert wait_until(300, 6, 12, check_appl_db, duthost, ctrl_links, policy, cipher_suite, send_sci)