Skip to content
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

tests: multiple OSPF routers connected to a single switch #14708

Closed

Conversation

adrianomarto
Copy link
Contributor

@adrianomarto adrianomarto commented Nov 1, 2023

Tests a large set of OSPF routers connected to the same switch. Each router shares a single network. All shared networks must be reachable from all routers. I don't expect the CI to succeed on dev/9.1 (at least until the issue is fixed).

@adrianomarto
Copy link
Contributor Author

I created this pull request to support the following issue report:
#14709

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

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

ip address 120.0.0.1/24
ip ospf network point-to-multipoint
ip ospf area 0.0.0.0
#ip ospf prefix-suppression
Copy link
Member

Choose a reason for hiding this comment

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

Incorrect comment symbol for vtysh, use !.

@@ -0,0 +1,19 @@
!
hostname r1
log file /tmp/r1-frr.log
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed.

@@ -0,0 +1,19 @@
!
hostname r2
log file /tmp/r2-frr.log
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

ip address 120.0.0.2/24
ip ospf network point-to-multipoint
ip ospf area 0.0.0.0
#ip ospf prefix-suppression
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@@ -0,0 +1,19 @@
!
hostname r3
log file /tmp/r3-frr.log
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

sys.path.append(os.path.join(CWD, "../"))

# Required to instantiate the topology builder class.
pytestmark = [pytest.mark.ospfd, pytest.mark.bgpd]
Copy link
Member

Choose a reason for hiding this comment

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

bgpd is not needed here


# networks advertised by each router and the expected next hops
networks = {
"r1": ("10.0.1.0/24", "120.0.0.1"),
Copy link
Member

Choose a reason for hiding this comment

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

Can you please use IPv4 documentation ranges or private ranges instead of 120...?

check_route(router_orig, network[0], network[1])


def check_route(router_name, network, expected_nexthop):
Copy link
Member

Choose a reason for hiding this comment

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

Can't this be replaced to our existing function verify_rib()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the functions verify_rib() and verify_ospf_rib(), but they don't do what is required. They only check the presence of the expected route, but they don't check if they are active. As a result, they succeed in cases where check_route() fails. For now, I am leaving verify_rib(), verify_ospf_rib(), and check_route().

), f"{router_name} (ospfd): no route {network} via {expected_nexthop}\n{dump_routes(router)}"

address = network.split("/")[0]
route = router.run(f"ip route get {address}")
Copy link
Member

Choose a reason for hiding this comment

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

Please use ip -j route ..., it's easier to parse.

), f"{router_name} (kernel): no route {address} via {expected_nexthop}\n{dump_routes(router)}"


def dump_routes(router):
Copy link
Member

Choose a reason for hiding this comment

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

I think verify_rib() gives enough details when failing, I doubt this is useful to have.

A large set of routers are connected to the same switch. Each router
shares a single network. All shared networks must be reachable from all
routers.

Signed-off-by: "Adriano Marto Reis" <[email protected]>
@adrianomarto adrianomarto force-pushed the test_ospfd_single_switch branch from 5f9e6b5 to 3ed36c6 Compare November 3, 2023 02:00
@adrianomarto
Copy link
Contributor Author

This is the pull request that fixes the problem uncovered here. Should I cherry-pick the changes into the current pull request?
#14033

@ton31337
Copy link
Member

ton31337 commented Nov 4, 2023

Oh, I've just realized this is based on dev/9.1. It should be based on the master branch. Why is this for dev/9.1?

@adrianomarto
Copy link
Contributor Author

adrianomarto commented Nov 4, 2023

I created this pull request to demonstrate the issue #14709, which is present in dev/9.1 but not in the master branch.

@adrianomarto adrianomarto requested a review from ton31337 November 7, 2023 01:23
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks okay other than existing comments ...

@ton31337
Copy link
Member

ton31337 commented Nov 9, 2023

@adrianomarto we need to find the commit that needs to be backported to 9.1 then instead.

@ton31337 ton31337 closed this Nov 9, 2023
@acooks
Copy link

acooks commented Jan 17, 2024

Currently open issue #14709 links here. This PR has been replaced by PR #14775

@adrianomarto
Copy link
Contributor Author

This is the commit that fixed the issue in the master branch:

commit a272a2b
Author: Donald Sharp [email protected]
Date: Thu Oct 19 16:38:12 2023 -0400
zebra: Allow longer prefix matches for nexthops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/9.1 size/L tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants