diff --git a/orchagent/main.cpp b/orchagent/main.cpp index 556bb70892..d50508f6ce 100644 --- a/orchagent/main.cpp +++ b/orchagent/main.cpp @@ -73,7 +73,7 @@ uint32_t create_switch_timeout = 0; void usage() { - cout << "usage: orchagent [-h] [-r record_type] [-d record_location] [-f swss_rec_filename] [-j sairedis_rec_filename] [-b batch_size] [-m MAC] [-i INST_ID] [-s] [-z mode] [-k bulk_size] [-q zmq_server_address] [-c mode] [-t create_switch_timeout]" << endl; + cout << "usage: orchagent [-h] [-r record_type] [-d record_location] [-f swss_rec_filename] [-j sairedis_rec_filename] [-b batch_size] [-m MAC] [-i INST_ID] [-s] [-z mode] [-k bulk_size] [-q zmq_server_address] [-c mode] [-t create_switch_timeout] [-v VRF]" << endl; cout << " -h: display this message" << endl; cout << " -r record_type: record orchagent logs with type (default 3)" << endl; cout << " Bit 0: sairedis.rec, Bit 1: swss.rec, Bit 2: responsepublisher.rec. For example:" << endl; @@ -94,6 +94,7 @@ void usage() cout << " -q zmq_server_address: ZMQ server address (default disable ZMQ)" << endl; cout << " -c counter mode (traditional|asic_db), default: asic_db" << endl; cout << " -t Override create switch timeout, in sec" << endl; + cout << " -v vrf: VRF name (default empty)" << endl; } void sighup_handler(int signo) @@ -344,11 +345,12 @@ int main(int argc, char **argv) string swss_rec_filename = Recorder::SWSS_FNAME; string sairedis_rec_filename = Recorder::SAIREDIS_FNAME; string zmq_server_address = "tcp://127.0.0.1:" + to_string(ORCH_ZMQ_PORT); + string vrf; bool enable_zmq = false; string responsepublisher_rec_filename = Recorder::RESPPUB_FNAME; int record_type = 3; // Only swss and sairedis recordings enabled by default. - while ((opt = getopt(argc, argv, "b:m:r:f:j:d:i:hsz:k:q:c:t:")) != -1) + while ((opt = getopt(argc, argv, "b:m:r:f:j:d:i:hsz:k:q:c:t:v:")) != -1) { switch (opt) { @@ -442,6 +444,12 @@ int main(int argc, char **argv) case 't': create_switch_timeout = atoi(optarg); break; + case 'v': + if (optarg) + { + vrf = optarg; + } + break; default: /* '?' */ exit(EXIT_FAILURE); } @@ -486,8 +494,8 @@ int main(int argc, char **argv) shared_ptr zmq_server = nullptr; if (enable_zmq) { - SWSS_LOG_NOTICE("Instantiate ZMQ server : %s", zmq_server_address.c_str()); - zmq_server = make_shared(zmq_server_address.c_str()); + SWSS_LOG_NOTICE("Instantiate ZMQ server : %s, %s", zmq_server_address.c_str(), vrf.c_str()); + zmq_server = make_shared(zmq_server_address.c_str(), vrf.c_str()); } else { diff --git a/tests/test_zmq.py b/tests/test_zmq.py index 4894df0751..0f7e5359f3 100644 --- a/tests/test_zmq.py +++ b/tests/test_zmq.py @@ -103,3 +103,20 @@ def test_appliance(self, dvs): for fv in fvs.items(): if fv[0] == "SAI_VIP_ENTRY_ATTR_ACTION": assert fv[1] == "SAI_VIP_ENTRY_ACTION_ACCEPT" + + def test_vrf(self, dvs): + # Improve test code coverage, change orchagent to use VRF + dvs.runcmd("cp /usr/bin/orchagent.sh /usr/bin/orchagent.sh_vrf_ut_backup") + dvs.runcmd("sed -i.bak 's/\/usr\/bin\/orchagent /\/usr\/bin\/orchagent -v mgmt /g' /usr/bin/orchagent.sh") + dvs.stop_swss() + dvs.start_swss() + + # wait orchagent start + time.sleep(3) + process_statue = dvs.runcmd("ps -ef") + zmq_logger.debug("Process status: {}".format(process_statue)) + + # revert change + dvs.runcmd("cp /usr/bin/orchagent.sh_vrf_ut_backup /usr/bin/orchagent.sh") + dvs.stop_swss() + dvs.start_swss() diff --git a/tlm_teamd/values_store.cpp b/tlm_teamd/values_store.cpp index f883d22fd3..a955d36be7 100644 --- a/tlm_teamd/values_store.cpp +++ b/tlm_teamd/values_store.cpp @@ -366,7 +366,13 @@ void ValuesStore::update(const std::vector & dumps) { const auto & storage = from_json(dumps); const auto & old_keys = get_old_keys(storage); - remove_keys_db(old_keys); + // Do not delete te key from State Db. State DB LAB_TABLE entry is created/deleted + // from teamsyncd on detecting netlink of teamd dev as up/down. For some reason + // if we do not get state dump from teamdctl it might be transient issue. If it is + // persistent issue then teamsyncd might be able to catch it and delete state db entry + // or we can keep entry in it's current state as best effort. Similar to try_add_lag which is best effort + // to connect to teamdctl and if it fails we do not delete State Db entry. + //remove_keys_db(old_keys); remove_keys_storage(old_keys); const auto & keys_to_refresh = update_storage(storage); update_db(storage, keys_to_refresh);