diff --git a/Tests/OpenVPNAdapterTests.swift b/Tests/OpenVPNAdapterTests.swift index 209329e..eb3a29d 100644 --- a/Tests/OpenVPNAdapterTests.swift +++ b/Tests/OpenVPNAdapterTests.swift @@ -75,13 +75,27 @@ class OpenVPNAdapterTests: XCTestCase { let configuration = OpenVPNConfiguration() configuration.fileContent = vpnConfiguration - + + let result: OpenVPNProperties do { - _ = try adapter.apply(configuration: configuration) + result = try adapter.apply(configuration: configuration) } catch { XCTFail("Failed to configure OpenVPN adapted due to error: \(error)") return } + + if !result.autologin { + let credentials = OpenVPNCredentials() + credentials.username = VPNProfile.username + credentials.password = VPNProfile.password + + do { + try adapter.provide(credentials: credentials) + } catch { + XCTFail("Failed to provide credentials. \(error)") + return + } + } expectations[.connection] = expectation(description: "me.ss-abramchuk.openvpn-adapter.connection")