diff options
author | gjoranv <gjoranv@gmail.com> | 2023-09-05 13:17:10 +0200 |
---|---|---|
committer | gjoranv <gjoranv@gmail.com> | 2023-09-14 14:46:12 +0200 |
commit | 5e7aea140634f222ac6c4a3192e8dbd65b2b3985 (patch) | |
tree | b118ca3a40ed020e0395425b45367f19d60a1de7 /node-admin/src/test/java/com | |
parent | b51d07196d344abad4c8188bf0b1f0ed237a51a2 (diff) |
Add wireguard key timestamp to node repo and WireguardPeer
- Set from NodePatcher clock.
- Add UNINITIALIZED wireguard key constant
Diffstat (limited to 'node-admin/src/test/java/com')
2 files changed, 4 insertions, 1 deletions
diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java index 6358fcecafb..d5e6ae59c62 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/configserver/noderepository/RealNodeRepositoryTest.java @@ -139,6 +139,7 @@ public class RealNodeRepositoryTest { var hostname = "host4.yahoo.com"; var dockerImage = "registry.example.com/repo/image-1:6.2.3"; var wireguardKey = WireguardKey.from("111122223333444455556666777788889999000042c="); + var wireguardKeyTimestamp = Instant.ofEpochMilli(321L); nodeRepositoryApi.updateNodeAttributes( hostname, @@ -151,6 +152,7 @@ public class RealNodeRepositoryTest { assertEquals(1, hostSpec.currentRestartGeneration().orElseThrow()); assertEquals(dockerImage, hostSpec.currentDockerImage().orElseThrow().asString()); assertEquals(wireguardKey.value(), hostSpec.wireguardPubkey().orElseThrow().value()); + assertEquals(wireguardKeyTimestamp, hostSpec.wireguardKeyTimestamp().orElseThrow()); } @Test diff --git a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/wireguard/WireguardPeerTest.java b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/wireguard/WireguardPeerTest.java index 00aca5c5e4d..cd76b221c9e 100644 --- a/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/wireguard/WireguardPeerTest.java +++ b/node-admin/src/test/java/com/yahoo/vespa/hosted/node/admin/wireguard/WireguardPeerTest.java @@ -5,6 +5,7 @@ import com.yahoo.config.provision.WireguardKey; import com.yahoo.vespa.hosted.node.admin.task.util.network.VersionedIpAddress; import org.junit.jupiter.api.Test; +import java.time.Instant; import java.util.List; import java.util.stream.Stream; @@ -30,6 +31,6 @@ public class WireguardPeerTest { private static WireguardPeer peer(String hostname) { return new WireguardPeer(HostName.of(hostname), List.of(VersionedIpAddress.from("::1:1")), - WireguardKey.generateRandomForTesting()); + WireguardKey.generateRandomForTesting(), Instant.EPOCH); } } |