mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-10-17 01:56:14 -08:00
allow provider detect dynamically
This commit is contained in:
1 parent
7908f9c146
commit
463228f1de
8 files changed
+966
-570
No files matched your search
@@ -766,8 +766,7 @@ pub async fn public_ipv6_auto_addr_end_to_end() {
|
||||
|| async {
|
||||
provider
|
||||
.get_global_ctx()
|
||||
.config
|
||||
.get_ipv6_public_addr_prefix()
|
||||
.get_advertised_ipv6_public_addr_prefix()
|
||||
== Some(PublicIpv6Lab::PROVIDER_PREFIX.parse().unwrap())
|
||||
},
|
||||
Duration::from_secs(10),
|
||||
@@ -782,8 +781,32 @@ pub async fn public_ipv6_auto_addr_end_to_end() {
|
||||
.get_global_ctx()
|
||||
.config
|
||||
.get_ipv6_public_addr_prefix(),
|
||||
None
|
||||
);
|
||||
assert_eq!(
|
||||
provider
|
||||
.get_global_ctx()
|
||||
.get_advertised_ipv6_public_addr_prefix(),
|
||||
Some(PublicIpv6Lab::PROVIDER_PREFIX.parse().unwrap())
|
||||
);
|
||||
let provider_prefix = PublicIpv6Lab::PROVIDER_PREFIX
|
||||
.parse::<cidr::Ipv6Cidr>()
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
provider
|
||||
.get_peer_manager()
|
||||
.get_my_info()
|
||||
.await
|
||||
.ipv6_public_addr_prefix,
|
||||
Some(
|
||||
cidr::Ipv6Inet::new(
|
||||
provider_prefix.first_address(),
|
||||
provider_prefix.network_length()
|
||||
)
|
||||
.unwrap()
|
||||
.into()
|
||||
)
|
||||
);
|
||||
assert!(
|
||||
leased.address().segments()[0] & 0xfe00 != 0xfc00,
|
||||
"leased address should not be unique-local: {leased}"
|
||||
|
||||
Reference in new issue
Block a user