Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Breakout huge test file and code cleanup #153

Merged
merged 13 commits into from
Oct 22, 2020

Conversation

er1cthe0ne
Copy link
Contributor

This PR addresses futurewei-cloud/alcor#416

It include the following changes:

  1. break out of the current huge aca test files into aca_test_main.cpp aca_test_dhcp.cpp aca_test_net_config.cpp aca_test_openflow.cpp aca_test_ovs_l2.cpp aca_test_ovs_l3.cpp
  2. README files cleanup and update
  3. delete unneeded legacy files
  4. remove the requirement/assert of format_version in each resource configuration level per latest contract

Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some early feedback.

using grpc::Status;

static std::atomic<bool> running;
Aca_Async_GRPC_Server::~Aca_Async_GRPC_Server()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a legacy implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's the old implementation, not being compiled anymore.

@@ -154,9 +154,6 @@ void Aca_Comm_Manager::print_goal_state(GoalState parsed_struct)
VpcConfiguration current_VpcConfiguration =
parsed_struct.vpc_states(i).configuration();

fprintf(stdout, "current_VpcConfiguration.format_version(): %d\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format version will come back in the form of ACA logger, right? :)

@@ -104,8 +104,6 @@ int ACA_Dataplane_OVS::update_port_state_workitem(const PortState current_PortSt

PortConfiguration current_PortConfiguration = current_PortState.configuration();

assert(current_PortConfiguration.format_version() > 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This asseration looks okay though.

@@ -203,7 +203,6 @@ class GoalStateProvisionerClient {

SubnetConfiguration *SubnetConiguration_builder =
new_subnet_states->mutable_configuration();
SubnetConiguration_builder->set_format_version(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate a bit why we need to remove format version related codes and UT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on previous experience on newer DPM goal state send down to older ACA, when a field is added/removed inside a top level resource state (Subnet/Port/DHCP etc), it will shift the next fields and also next source state in a goal state message. Therefore, having format version in each resource state is not useful.

We will keep the format version on the top level GoalState message and use that one only:
message GoalState {
uint32 format_version = 1; <------- only use this one

repeated VpcState vpc_states = 2;
repeated SubnetState subnet_states = 3;
repeated PortState port_states = 4;
repeated NeighborState neighbor_states = 5;
repeated SecurityGroupState security_group_states = 6;
repeated DHCPState dhcp_states = 7;
repeated RouterState router_states = 8;

}

The final strategy will be addressed by futurewei-cloud/alcor#211, that could be:

message GoalState {
uint32 format_version = 1;

repeated VpcState vpc_states = 2;
repeated SubnetState subnet_states = 3;
repeated PortState port_states = 4;
repeated NeighborState neighbor_states = 5;
repeated SecurityGroupState security_group_states = 6;
repeated DHCPState dhcp_states = 7;
repeated RouterState router_states = 8;
ExtraState extra_state = 9;     <-------- we can only add new fields at the end

}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. As we collect more and more experiences on GS change along the way, I think backward- and forward- compatibility strategy becomes clearer. We should spend some time after 11/30 release to consolidate the idea and document it.

Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, it looks good.

using namespace aca_dhcp_server;
using namespace aca_dhcp_programming_if;

TEST(dhcp_config_test_cases, add_dhcp_entry_valid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For each major category of UTs, can we add a few lines of comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, that's easy, will add that before merging.

luyaoluo and others added 8 commits October 22, 2020 10:36
* Add pulsar dependencies and pulsar consumer

* update aca_main.cpp with entry points to pulsar

* rename MessageConsumer to MessagePulsarConsumer

* fix aca_main.cpp

* fix a wrong symbol

* update gs_tests

* update namespace and class name

* a line of code was deleted by mistake

* add producer and test

* fix remaining bugs

* resolve conflicts in Dockerfile

* fix a bug

* fix a bug

* fix a bug

* missing producer in cmakelists

* fix a bug
@er1cthe0ne er1cthe0ne merged commit 4890375 into futurewei-cloud:master Oct 22, 2020
@er1cthe0ne er1cthe0ne deleted the test_cleanup branch November 25, 2020 01:17
zhangml pushed a commit to zhangml/alcor-control-agent that referenced this pull request Dec 7, 2020
…wei-cloud#153)

* add one-box deployment script and k8s yaml file for ignite

* add some test cases for the db module

* db test case of multiple clients write the same record
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants