-
Notifications
You must be signed in to change notification settings - Fork 55
feat: Run testcases in parallel #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
larseggert
wants to merge
1
commit into
quic-interop:master
Choose a base branch
from
larseggert:feat-parallel-runs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,31 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| echo "Setting up routes..." | ||
| # By default, docker containers don't compute UDP / TCP checksums. | ||
| # When packets run through ns3 however, the receiving endpoint requires valid checksums. | ||
| # This command makes sure that the endpoints set the checksum on outgoing packets. | ||
| ethtool -K eth0 tx off | ||
|
|
||
| # this relies on the IPv4 address being first in the "hostname -I" output | ||
| IP=$(hostname -I | cut -f1 -d" ") | ||
| GATEWAY="${IP%.*}.2" | ||
| UNNEEDED_ROUTE="${IP%.*}.0" | ||
| echo "Endpoint's IPv4 address is $IP" | ||
|
|
||
| route add -net 193.167.0.0 netmask 255.255.0.0 gw $GATEWAY | ||
| route add -net "$SUBNET_V4$SUBNET_V4_SUBNET/$SUBNET_V4_PREFIX" gw "$GATEWAY" | ||
| # delete unused route | ||
| route del -net $UNNEEDED_ROUTE netmask 255.255.255.0 | ||
| route del -net "$UNNEEDED_ROUTE" netmask 255.255.255.0 | ||
|
|
||
| # this relies on the IPv6 address being second in the "hostname -I" output | ||
| IP=$(hostname -I | cut -f2 -d" ") | ||
| GATEWAY="${IP%:*}:2" | ||
| UNNEEDED_ROUTE="${IP%:*}:" | ||
| echo "Endpoint's IPv6 address is $IP" | ||
|
|
||
| ip -d route add fd00:cafe:cafe::/48 via $GATEWAY | ||
| ip -d route add "$SUBNET_V6::/$SUBNET_V6_PREFIX" via "$GATEWAY" | ||
| # delete unused route | ||
| ip -d route del $UNNEEDED_ROUTE/64 | ||
| ip -d route del "$UNNEEDED_ROUTE/64" | ||
|
|
||
| # create the /logs and the /logs/qlog directory | ||
| mkdir -p /logs/qlog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| #ifndef NETWORK_CONFIG_H | ||
| #define NETWORK_CONFIG_H | ||
|
|
||
| #include <string> | ||
| #include <cstdlib> | ||
| #include "ns3/core-module.h" | ||
| #include "ns3/ipv4-address.h" | ||
| #include "ns3/ipv6-address.h" | ||
|
|
||
| namespace ns3 { | ||
|
|
||
| class NetworkConfig { | ||
| public: | ||
| // Singleton instance to ensure we read environment variables only once. | ||
| static const NetworkConfig& Instance() { | ||
| static NetworkConfig instance; | ||
| return instance; | ||
| } | ||
|
|
||
| const std::string& GetClientV4Addr() const { return client_v4_addr_; } | ||
| const std::string & GetServerV4Addr() const | ||
| { | ||
| return server_v4_addr_; | ||
| } | ||
| const std::string& GetClientV6Addr() const { return client_v6_addr_; } | ||
| const std::string& GetServerV6Addr() const { return server_v6_addr_; } | ||
|
|
||
| Ipv4Address GetClientV4Address() const { | ||
| return Ipv4Address(client_v4_addr_.c_str()); | ||
| } | ||
|
|
||
| Ipv4Address GetServerV4Address() const { | ||
| return Ipv4Address(server_v4_addr_.c_str()); | ||
| } | ||
|
|
||
| const std::string & GetClientGatewayV4Addr() const | ||
| { | ||
| return client_v4_gateway_; | ||
| } | ||
|
|
||
| const std::string & GetServerGatewayV4Addr() const | ||
| { | ||
| return server_v4_gateway_; | ||
| } | ||
|
|
||
| const std::string & GetClientGatewayV6Addr() const | ||
| { | ||
| return client_v6_gateway_; | ||
| } | ||
|
|
||
| const std::string & GetServerGatewayV6Addr() const | ||
| { | ||
| return server_v6_gateway_; | ||
| } | ||
|
|
||
| const std::string & GetLeftNetName() const | ||
| { | ||
| return leftnet_name_; | ||
| } | ||
|
|
||
| const std::string & GetRightNetName() const | ||
| { | ||
| return rightnet_name_; | ||
| } | ||
|
|
||
| std::string GetV4PointToPointNetwork() const { | ||
| return subnet_v4_ + ".255.0"; | ||
| } | ||
|
|
||
| std::string GetV4SubnetMask() const { | ||
| return "255.255.255.0"; | ||
| } | ||
|
|
||
| std::string GetV6PointToPointNetwork() const { | ||
| return subnet_v6_ + ":255::"; | ||
| } | ||
|
|
||
| int GetV6PrefixInt() const { | ||
| return std::stoi(v6_prefix_); | ||
| } | ||
|
|
||
| private: | ||
| NetworkConfig() { | ||
| // SUBNET_V4: Base IPv4 network prefix (e.g., "10.0") | ||
| subnet_v4_ = GetEnvVar("SUBNET_V4"); | ||
|
|
||
| // CLIENT_V4_ADDR: Client IPv4 address (e.g., "10.0.10.10") | ||
| client_v4_addr_ = GetEnvVar("CLIENT_V4_ADDR"); | ||
|
|
||
| // SERVER_V4_ADDR: Server IPv4 address (e.g., "10.0.222.222") | ||
| server_v4_addr_ = GetEnvVar("SERVER_V4_ADDR"); | ||
|
|
||
| // CLIENT_V4_GATEWAY: Client gateway IPv4 address (e.g., "10.0.10.2") | ||
| client_v4_gateway_ = GetEnvVar("CLIENT_V4_GATEWAY"); | ||
|
|
||
| // SERVER_V4_GATEWAY: Server gateway IPv4 address (e.g., "10.0.222.2") | ||
| server_v4_gateway_ = GetEnvVar("SERVER_V4_GATEWAY"); | ||
|
|
||
| // SUBNET_V6: Base IPv6 network prefix (e.g., "fd00:cafe:0000") | ||
| subnet_v6_ = GetEnvVar("SUBNET_V6"); | ||
|
|
||
| // V6_PREFIX: IPv6 prefix length (e.g., "64") | ||
| v6_prefix_ = GetEnvVar("V6_PREFIX"); | ||
|
|
||
| // CLIENT_V6_ADDR: Client IPv6 address (e.g., "fd00:cafe:0000:10::10") | ||
| client_v6_addr_ = GetEnvVar("CLIENT_V6_ADDR"); | ||
|
|
||
| // SERVER_V6_ADDR: Server IPv6 address (e.g., "fd00:cafe:0000:222::222") | ||
| server_v6_addr_ = GetEnvVar("SERVER_V6_ADDR"); | ||
|
|
||
| // CLIENT_V6_GATEWAY: Client gateway IPv6 address (e.g., | ||
| // "fd00:cafe:0000:10::2") | ||
| client_v6_gateway_ = GetEnvVar("CLIENT_V6_GATEWAY"); | ||
|
|
||
| // SERVER_V6_GATEWAY: Server gateway IPv6 address (e.g., | ||
| // "fd00:cafe:0000:222::2") | ||
| server_v6_gateway_ = GetEnvVar("SERVER_V6_GATEWAY"); | ||
|
|
||
| // LEFTNET_NAME: Left network interface name (e.g., "eth0") | ||
| leftnet_name_ = GetEnvVar("LEFTNET_NAME"); | ||
|
|
||
| // RIGHTNET_NAME: Right network interface name (e.g., "eth1") | ||
| rightnet_name_ = GetEnvVar("RIGHTNET_NAME"); | ||
|
|
||
| // V4_PREFIX: IPv4 prefix length - must always be "24" | ||
| std::string v4_prefix = GetEnvVar("V4_PREFIX"); | ||
| NS_ABORT_MSG_IF(v4_prefix != "24", "V4_PREFIX must be 24, but got: " << v4_prefix); | ||
| } | ||
|
|
||
| static std::string GetEnvVar(const std::string& var_name) { | ||
| const char* value = std::getenv(var_name.c_str()); | ||
| NS_ABORT_MSG_IF(value == nullptr, "Environment variable " << var_name << " is not set."); | ||
| return std::string(value); | ||
| } | ||
|
|
||
| std::string subnet_v4_; | ||
| std::string client_v4_addr_; | ||
| std::string server_v4_addr_; | ||
| std::string client_v4_gateway_; | ||
| std::string server_v4_gateway_; | ||
| std::string subnet_v6_; | ||
| std::string v6_prefix_; | ||
| std::string client_v6_addr_; | ||
| std::string server_v6_addr_; | ||
| std::string client_v6_gateway_; | ||
| std::string server_v6_gateway_; | ||
| std::string leftnet_name_; | ||
| std::string rightnet_name_; | ||
| }; | ||
|
|
||
| } // namespace ns3 | ||
|
|
||
| #endif // NETWORK_CONFIG_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a compilation warning.