Skip to content

Commit 141cc57

Browse files
committed
itest: check for config addrs precedence
In this commit, we update the itest to check for precedence of the config addresses over the persisted addresses. We did not check for address persistence after restart (without the extraArgs `--externalip`) because in `lntest/node/config.goL300`, `GenArg` by default sets the `--externalip` flag, which makes the config addrs to always take precedence over the persisted addrs, for the tests.
1 parent cf287e9 commit 141cc57

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

itest/lnd_channel_graph_test.go

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -728,25 +728,7 @@ func testSelfNodeAnnouncementPersistence(ht *lntest.HarnessTest) {
728728
}
729729
assertUpdateNodeAnnouncementResponse(ht, response, expectedOps)
730730

731-
resp = alice.RPC.GetInfo()
732-
assertNodeInfo(
733-
resp, "alice", "#eeeeee", "192.168.1.10:8333",
734-
"192.168.1.11:8333",
735-
)
736-
737-
// Restart Alice.
738-
ht.RestartNode(alice)
739-
740-
// After restarting, the node info should contain the values that were
741-
// set in the update request since the updated values take precedence
742-
// over the default values.
743-
resp = alice.RPC.GetInfo()
744-
assertNodeInfo(
745-
resp, "alice", "#eeeeee", "192.168.1.10:8333",
746-
"192.168.1.11:8333",
747-
)
748-
749-
// Test that we can still remove an address.
731+
// Test that we can remove an address.
750732
removeAddrReq := &peersrpc.NodeAnnouncementUpdateRequest{
751733
AddressUpdates: []*peersrpc.UpdateAddressAction{
752734
{
@@ -761,6 +743,20 @@ func testSelfNodeAnnouncementPersistence(ht *lntest.HarnessTest) {
761743
}
762744
assertUpdateNodeAnnouncementResponse(ht, response, expectedOps)
763745

746+
resp = alice.RPC.GetInfo()
747+
assertNodeInfo(
748+
resp, "alice", "#eeeeee", "192.168.1.11:8333",
749+
)
750+
751+
// Restart Alice.
752+
ht.RestartNode(alice)
753+
754+
// After restarting, the node info should contain the values that were
755+
// set in the update request since the updated values take precedence
756+
// over the default values.
757+
resp = alice.RPC.GetInfo()
758+
assertNodeInfo(resp, "alice", "#eeeeee")
759+
764760
// Now we restart the node with custom values in the config.
765761
lndArgs := []string{
766762
"--externalip=192.168.1.12:8333",
@@ -772,16 +768,11 @@ func testSelfNodeAnnouncementPersistence(ht *lntest.HarnessTest) {
772768

773769
// Get the node info and verify that the values are the same as the
774770
// ones we set in the config (and not the updated values).
775-
// The addresses should be the same as the ones we set in the config
776-
// plus the ones we set in the update request earlier.
777771
resp = alice.RPC.GetInfo()
778772
assertNodeInfo(
779-
resp, "alice-updated", "#ffffff", "192.168.1.11:8333",
780-
"192.168.1.12:8333", "192.168.1.13:8333",
773+
resp, "alice-updated", "#ffffff", "192.168.1.12:8333",
774+
"192.168.1.13:8333",
781775
)
782-
783-
// The address we removed earlier should not be present.
784-
require.Error(ht, assertAddrs(resp.Uris, "192.168.1.10:8333"))
785776
}
786777

787778
// assertSyncType asserts that the peer has an expected syncType.

0 commit comments

Comments
 (0)