-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71cbbcb
commit f471891
Showing
44 changed files
with
1,413 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,4 +308,4 @@ RUBY VERSION | |
ruby 2.6.5p114 | ||
|
||
BUNDLED WITH | ||
2.3.13 | ||
2.3.16 |
72 changes: 72 additions & 0 deletions
72
IntegrationTests/HealthCardControl/HealthCardTypeExtResetRetryCounterIntegrationTest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// | ||
// Copyright (c) 2022 gematik GmbH | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the License); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an 'AS IS' BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
import HealthCardAccess | ||
@testable import HealthCardControl | ||
import Nimble | ||
import XCTest | ||
|
||
final class HealthCardTypeExtResetRetryCounterIntegrationTest: CardSimulationTerminalTestCase { | ||
override class var configFileInput: String { | ||
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml" | ||
} | ||
|
||
override class var healthCardStatusInput: HealthCardStatus { .valid(cardType: .egk(generation: .g2_1)) } | ||
|
||
func testResetRetryCounterEgk21_success() throws { | ||
let puk = "12345678" as Format2Pin | ||
|
||
expect( | ||
try Self.healthCard.resetRetryCounter( | ||
puk: puk, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.success | ||
} | ||
|
||
func testResetRetryCounterWithNewPinEgk21_success() throws { | ||
let puk = "12345678" as Format2Pin | ||
let newPin = "654321" as Format2Pin | ||
|
||
expect( | ||
try Self.healthCard.resetRetryCounterAndSetNewPin( | ||
puk: puk, | ||
newPin: newPin, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.success | ||
} | ||
|
||
func testResetRetryCounterWithNewPinEgk21_wrongPasswordLength() throws { | ||
let puk = "12345678" as Format2Pin | ||
let tooLongNewPin = "654112341234" as Format2Pin | ||
|
||
expect( | ||
try Self.healthCard.resetRetryCounterAndSetNewPin( | ||
puk: puk, | ||
newPin: tooLongNewPin, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.wrongPasswordLength | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
...rationTests/HealthCardControl/HealthCardTypeExtResetRetryCounterIntegrationTestCont.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// Copyright (c) 2022 gematik GmbH | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the License); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an 'AS IS' BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
import HealthCardAccess | ||
@testable import HealthCardControl | ||
import Nimble | ||
import XCTest | ||
|
||
// Note: This continuation of `HealthCardTypeExtResetRetryCounterIntegrationTest` exists to separate the count dependent | ||
// tests from the other ones. | ||
final class HealthCardTypeExtResetRetryCounterIntegrationTestCont: CardSimulationTerminalTestCase { | ||
override class var configFileInput: String { | ||
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml" | ||
} | ||
|
||
override class var healthCardStatusInput: HealthCardStatus { .valid(cardType: .egk(generation: .g2_1)) } | ||
|
||
func testResetRetryCounterEgk21_wrongSecretWarning() throws { | ||
let wrongPuk = "9999999" as Format2Pin | ||
let newPin = "654321" as Format2Pin | ||
|
||
// With setting a new PIN | ||
expect( | ||
try Self.healthCard.resetRetryCounterAndSetNewPin( | ||
puk: wrongPuk, | ||
newPin: newPin, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 9) | ||
|
||
expect( | ||
try Self.healthCard.resetRetryCounterAndSetNewPin( | ||
puk: wrongPuk, | ||
newPin: newPin, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 8) | ||
|
||
// Without setting a new PIN | ||
expect( | ||
try Self.healthCard.resetRetryCounter( | ||
puk: wrongPuk, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 7) | ||
|
||
expect( | ||
try Self.healthCard.resetRetryCounter( | ||
puk: wrongPuk, | ||
type: EgkFileSystem.Pin.mrpinHome, | ||
dfSpecific: false | ||
) | ||
.test() | ||
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 6) | ||
} | ||
} |
Oops, something went wrong.