From: Razvan Becheriu Date: Wed, 19 Feb 2020 11:29:41 +0000 (+0200) Subject: [#1021] changed option parameter X-Git-Tag: Kea-1.7.5~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49ed63138bd07ca39de6ce0c3d4f2e930c814e58;p=thirdparty%2Fkea.git [#1021] changed option parameter --- diff --git a/src/bin/perfdhcp/command_options.cc b/src/bin/perfdhcp/command_options.cc index 071dba9234..ede03b197d 100644 --- a/src/bin/perfdhcp/command_options.cc +++ b/src/bin/perfdhcp/command_options.cc @@ -232,7 +232,7 @@ CommandOptions::initialize(int argc, char** argv, bool print_cmd_line) { // In this section we collect argument values from command line // they will be tuned and validated elsewhere while((opt = getopt_long(argc, argv, - "hv46aA:r:t:R:b:n:p:d:D:l:P:a:L:N:M:s:iBc1" + "huv46A:r:t:R:b:n:p:d:D:l:P:a:L:N:M:s:iBc1" "T:X:O:o:E:S:I:x:W:w:e:f:F:g:", long_options, NULL)) != -1) { stream << " -" << static_cast(opt); @@ -257,7 +257,7 @@ CommandOptions::initialize(int argc, char** argv, bool print_cmd_line) { } break; - case 'a': + case 'u': addr_unique_ = true; break; @@ -1105,7 +1105,7 @@ CommandOptions::printCommandLine() const { void CommandOptions::usage() const { std::cout << - "perfdhcp [-hva] [-4|-6] [-A] [-e]\n" + "perfdhcp [-huv] [-4|-6] [-A] [-e]\n" " [-r] [-f]\n" " [-F] [-t] [-R] [-b]\n" " [-n] [-p] [-d]\n" @@ -1143,7 +1143,7 @@ CommandOptions::usage() const { "-1: Take the server-ID option from the first received message.\n" "-4: DHCPv4 operation (default). This is incompatible with the -6 option.\n" "-6: DHCPv6 operation. This is incompatible with the -4 option.\n" - "-a: Enable checking address uniqueness. Lease valid lifetime\n" + "-u: Enable checking address uniqueness. Lease valid lifetime\n" " should not be shorter than test duration.\n" "-b: The base mac, duid, IP, etc, used to simulate different\n" " clients. This can be specified multiple times, each instance is\n" diff --git a/src/bin/perfdhcp/tests/basic_scen_unittest.cc b/src/bin/perfdhcp/tests/basic_scen_unittest.cc index 32bafa47cc..cd06e72259 100644 --- a/src/bin/perfdhcp/tests/basic_scen_unittest.cc +++ b/src/bin/perfdhcp/tests/basic_scen_unittest.cc @@ -245,7 +245,7 @@ TEST_F(BasicScenTest, Address4Unique) { // send more than 1 discover+request but with the same address // counter of a unique addresses should be 1 CommandOptions opt; - processCmdLine(opt, "perfdhcp -a -l fake -r 10 -n 10 -g single 127.0.0.1"); + processCmdLine(opt, "perfdhcp -u -l fake -r 10 -n 10 -g single 127.0.0.1"); NakedBasicScen bs(opt); bs.run(); EXPECT_GE(bs.fake_sock_.sent_cnt_, 5); // Discovery + Request @@ -261,7 +261,7 @@ TEST_F(BasicScenTest, Address6Unique) { // send more than 1 solicit+request but with the same address // counter of a unique addresses should be 1 CommandOptions opt; - processCmdLine(opt, "perfdhcp -6 -a -l fake -r 10 -n 10 -g single ::1"); + processCmdLine(opt, "perfdhcp -6 -u -l fake -r 10 -n 10 -g single ::1"); NakedBasicScen bs(opt); bs.run(); EXPECT_GE(bs.fake_sock_.sent_cnt_, 5); // Solicit + Request diff --git a/src/bin/perfdhcp/tests/command_options_unittest.cc b/src/bin/perfdhcp/tests/command_options_unittest.cc index 3223faa23c..4b46698b66 100644 --- a/src/bin/perfdhcp/tests/command_options_unittest.cc +++ b/src/bin/perfdhcp/tests/command_options_unittest.cc @@ -266,7 +266,7 @@ TEST_F(CommandOptionsTest, HelpVersion) { TEST_F(CommandOptionsTest, CheckAddressUniqueness) { CommandOptions opt; - EXPECT_NO_THROW(process(opt, "perfdhcp -6 -a -l ethx all")); + EXPECT_NO_THROW(process(opt, "perfdhcp -6 -u -l ethx all")); EXPECT_TRUE(opt.getAddrUnique()); }