@@ -345,6 +345,38 @@ TEST(counter, increase_counter)
345345 EXPECT_EQ (*ptr, " 1" );
346346}
347347
348+ TEST (counter, clear_counter)
349+ {
350+ std::shared_ptr<swss::DBConnector> state_db = std::make_shared<swss::DBConnector> (" STATE_DB" , 0 );
351+ std::string ifname = " Vlan1000" ;
352+ initialize_counter (state_db, ifname);
353+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Unknown" ));
354+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Solicit" ));
355+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Advertise" ));
356+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Request" ));
357+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Confirm" ));
358+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Renew" ));
359+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Rebind" ));
360+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Reply" ));
361+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Release" ));
362+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Decline" ));
363+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Relay-Forward" ));
364+ EXPECT_TRUE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Relay-Reply" ));
365+ clear_counter (state_db);
366+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Unknown" ));
367+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Solicit" ));
368+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Advertise" ));
369+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Request" ));
370+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Confirm" ));
371+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Renew" ));
372+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Rebind" ));
373+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Reply" ));
374+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Release" ));
375+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Decline" ));
376+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Relay-Forward" ));
377+ EXPECT_FALSE (state_db->hexists (" DHCPv6_COUNTER_TABLE|Vlan1000" , " Relay-Reply" ));
378+ }
379+
348380TEST (relay, relay_client)
349381{
350382 uint8_t msg[] = {
0 commit comments