Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pacemaker/_cts/cib.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def new_ip(self, name=None):

if ":" in ip:
r["cidr_netmask"] = "64"
r["nic"] = "eth0"
r["nic"] = self._cm.env["nic"]
else:
r["cidr_netmask"] = "32"

Expand Down
4 changes: 4 additions & 0 deletions python/pacemaker/_cts/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def _parse_args(self, argv):
grp2.add_argument("--ip", "--test-ip-base",
metavar="IP",
help="Offset for generated IP address resources")
grp2.add_argument("--nic",
default="eth0",
help="Network interface used for generated IP address resources")
Copy link
Contributor

Choose a reason for hiding this comment

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

We should note that this applies only if --ip is set to an IPv6 address.

Alternatively, we could modify cib.py so that it applies to both IPv4 and IPv6 base addresses.

As a side note, I'm not sure that explicitly setting a nic parameter is required anymore for IPv6, in most cases. It looks like the IPaddr2 resource agent should be able to find the correct interface via its findif.sh helper. For example:

IPv6 support in IPaddr2 was probably less mature (or perhaps nonexistent) when CTS lab was written.

Copy link
Member Author

@gao-yan gao-yan Nov 5, 2025

Choose a reason for hiding this comment

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

We should note that this applies only if --ip is set to an IPv6 address.

Alternatively, we could modify cib.py so that it applies to both IPv4 and IPv6 base addresses.

Makes sense. The latter sounds better to me.

As a side note, I'm not sure that explicitly setting a nic parameter is required anymore for IPv6, in most cases. It looks like the IPaddr2 resource agent should be able to find the correct interface via its findif.sh helper.

I assume so. But nic parameter is anyway mandatory for a link local address:

https://github.com/ClusterLabs/resource-agents/blob/44f1489bd8cc329d1f94a6907007159493b7cce6/heartbeat/findif.sh#L154-L159

, such as the ones by defaulting --ip.

Copy link
Member Author

@gao-yan gao-yan Nov 5, 2025

Choose a reason for hiding this comment

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

We might want something like: #3986

I'll have to test it tomorrow though.


grp3 = parser.add_argument_group("Options for release testing")
grp3.add_argument("-r", "--populate-resources",
Expand Down Expand Up @@ -349,6 +352,7 @@ def _parse_args(self, argv):
self["notification-agent"] = args.notification_agent
self["notification-recipient"] = args.notification_recipient
self["unsafe-tests"] = args.unsafe_tests
self["nic"] = args.nic

# Everything else either can't have a default set in an add_argument
# call (likely because we don't want to always have a value set for it)
Expand Down