Fix VPN internet connectivity and simplify client setup
Initialize Android physical interfaces and preserve macOS scoped routes. Add redacted diagnostics, default DNS, ordered auto-save, simplified controls, scanner rotation settings, and native regression coverage. Restore vendored build sources and document validation and stability checks.
This commit is contained in:
@@ -4,22 +4,42 @@ import 'package:meshport_client_core/meshport_client_core.dart';
|
||||
import 'package:meshport_lab/features/configuration_pages.dart';
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'client protects DNS and requires explicit resolver before connecting',
|
||||
() {
|
||||
final p = ProxyProfile();
|
||||
expect(p.runtime()['dns_protection'], true);
|
||||
expect(p.validateConnection, throwsStateError);
|
||||
p.proxyDnsServer = 'tls://resolver.example';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.proxyDnsServer = '';
|
||||
p.mode = 'direct';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.mode = 'global';
|
||||
p.feature = 'mesh';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
},
|
||||
);
|
||||
test('client supplies encrypted default DNS and protects proxy queries', () {
|
||||
final p = ProxyProfile();
|
||||
expect(p.runtime()['dns_protection'], true);
|
||||
expect(p.validateConnection, throwsFormatException);
|
||||
p.nodes = importProxyNodes('socks://127.0.0.1:1080').nodes;
|
||||
p.selectedId = p.nodes.single.id;
|
||||
p.proxyDnsServer = 'tls://resolver.example';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.proxyDnsServer = '';
|
||||
expect(p.runtime()['proxy_dns_server'], ProxyProfile.defaultProxyDns);
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.mode = 'direct';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.mode = 'global';
|
||||
p.feature = 'mesh';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
});
|
||||
|
||||
test('proxy requires a selected node, while direct and mesh do not', () {
|
||||
final p = ProxyProfile()..proxyDnsServer = 'tls://resolver.example';
|
||||
for (final mode in ['rule', 'global', 'bypass_cn']) {
|
||||
p.mode = mode;
|
||||
expect(p.validateConnection, throwsFormatException);
|
||||
}
|
||||
p.nodes = importProxyNodes('socks://127.0.0.1:1080').nodes;
|
||||
p.selectedId = 'deleted-node';
|
||||
expect(p.validateConnection, throwsFormatException);
|
||||
p.selectedId = p.nodes.single.id;
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.nodes.clear();
|
||||
p.mode = 'direct';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
p.mode = 'global';
|
||||
p.feature = 'mesh';
|
||||
expect(p.validateConnection, returnsNormally);
|
||||
});
|
||||
|
||||
test('China bypass mode persists without rewriting custom rules', () {
|
||||
final p = ProxyProfile()
|
||||
|
||||
Reference in New Issue
Block a user