From a45fb0f0dc5980143a355ef1074b7848eae23845 Mon Sep 17 00:00:00 2001 From: Piotrek Zadroga Date: Fri, 26 May 2023 15:19:55 +0200 Subject: [PATCH] [#2834] Addressed review comments --- doc/sphinx/man/perfdhcp.8.rst | 3 +-- src/bin/perfdhcp/tests/command_options_unittest.cc | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/sphinx/man/perfdhcp.8.rst b/doc/sphinx/man/perfdhcp.8.rst index 96cfdbd6ec..a8e62e94df 100644 --- a/doc/sphinx/man/perfdhcp.8.rst +++ b/doc/sphinx/man/perfdhcp.8.rst @@ -365,8 +365,7 @@ The following options only apply for DHCPv6 (i.e. when ``-6`` is given). specifies the option code and the hexstring is a hexadecimal string that defines the content of the option. Care should be taken as ``perfdhcp`` does not offer any kind of logic behind those options; they are simply - inserted into packets and sent as is. Be careful not to duplicate - options that are already inserted. Please notice that ``encapsulation-level:`` + inserted into packets and sent as is. Please notice that ``encapsulation-level:`` is optional and if omitted, default encapsulation-level value 1 is used. For example, to insert client class identifier (option code 60) with a string "docsis" at first level of encapsulation, use "--or 60,646f63736973" diff --git a/src/bin/perfdhcp/tests/command_options_unittest.cc b/src/bin/perfdhcp/tests/command_options_unittest.cc index c37a775d89..db4254a22b 100644 --- a/src/bin/perfdhcp/tests/command_options_unittest.cc +++ b/src/bin/perfdhcp/tests/command_options_unittest.cc @@ -1005,3 +1005,13 @@ TEST_F(CommandOptionsTest, UseRelayV6OptionsWithEncapsulationLevelValueTwo) { EXPECT_THROW(process(opt, "perfdhcp -6 -A1 --or 2:32,00000E10 -l ethx all"), isc::InvalidParameter); } +TEST_F(CommandOptionsTest, UseRelayV6OptionsDuplicated) { + CommandOptions opt; + + // multiple relayed options with the same option code are supported. + EXPECT_NO_THROW(process(opt, "perfdhcp -6 -A1 --or 1:32,00000E10 --or 32,00000E11 -l ethx all")); + EXPECT_TRUE(opt.isUseRelayedV6()); + EXPECT_EQ(2, opt.getRelayOpts().size()); +} + + -- 2.47.2