Skip to content

Commit

Permalink
Run tests on iOS using Mac Catalyst
Browse files Browse the repository at this point in the history
  • Loading branch information
complexspaces committed Oct 17, 2024
1 parent 8befd1d commit 45c360f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ jobs:
./android/emulator.log
/Users/runner/work/rustls-platform-verifier/rustls-platform-verifier/android/rustls-platform-verifier/build/outputs/androidTest-results/connected/test-result.pb
# TODO: Test iOS in CI too.
test_ios:
name: "Test (iOS Catalyst)"
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Run iOS tests
run: |
rustup target add aarch64-apple-ios-macabi
cargo test --target aarch64-apple-ios-macabi
test-freebsd:
name: Test (FreeBSD)
Expand Down
14 changes: 5 additions & 9 deletions rustls-platform-verifier/src/tests/verification_mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
//! any parts of the system outside of these tests. See the `#![cfg(...)]`
//! immediately below to see which platforms run these tests.
#![cfg(all(
any(windows, unix, target_os = "android"),
not(target_os = "ios"),
not(target_os = "tvos")
))]
#![cfg(all(any(windows, unix, target_os = "android"), not(target_os = "tvos"),))]

use super::TestCase;
use crate::tests::{assert_cert_error_eq, ensure_global_state, verification_time};
Expand Down Expand Up @@ -209,31 +205,31 @@ mock_root_test_cases! {
// Check that self-signed certificates, which may or may not be revokved, do not return any
// kind of revocation error. It is expected that non-public certificates without revocation information
// have no revocation checking performed across platforms.
revoked_dns [ any(windows, target_os = "android", target_os = "macos") ] => TestCase {
revoked_dns [ any(windows, target_os = "android", target_os = "macos", target_os = "ios") ] => TestCase {
reference_id: EXAMPLE_COM,
chain: &[include_bytes!("root1-int1-ee_example.com-revoked.crt"), ROOT1_INT1],
stapled_ocsp: None,
verification_time: verification_time(),
expected_result: Ok(()),
other_error: no_error!(),
},
stapled_revoked_dns [ any(windows, target_os = "android", target_os = "macos") ] => TestCase {
stapled_revoked_dns [ any(windows, target_os = "android", target_os = "macos", target_os = "ios") ] => TestCase {
reference_id: EXAMPLE_COM,
chain: &[include_bytes!("root1-int1-ee_example.com-revoked.crt"), ROOT1_INT1],
stapled_ocsp: Some(include_bytes!("root1-int1-ee_example.com-revoked.ocsp")),
verification_time: verification_time(),
expected_result: Err(TlsError::InvalidCertificate(CertificateError::Revoked)),
other_error: no_error!(),
},
stapled_revoked_ipv4 [ any(windows, target_os = "android", target_os = "macos") ] => TestCase {
stapled_revoked_ipv4 [ any(windows, target_os = "android", target_os = "macos", target_os = "ios") ] => TestCase {
reference_id: LOCALHOST_IPV4,
chain: &[include_bytes!("root1-int1-ee_127.0.0.1-revoked.crt"), ROOT1_INT1],
stapled_ocsp: Some(include_bytes!("root1-int1-ee_127.0.0.1-revoked.ocsp")),
verification_time: verification_time(),
expected_result: Err(TlsError::InvalidCertificate(CertificateError::Revoked)),
other_error: no_error!(),
},
stapled_revoked_ipv6 [ any(windows, target_os = "android", target_os = "macos") ] => TestCase {
stapled_revoked_ipv6 [ any(windows, target_os = "android", target_os = "macos", target_os = "ios") ] => TestCase {
reference_id: LOCALHOST_IPV6,
chain: &[include_bytes!("root1-int1-ee_1-revoked.crt"), ROOT1_INT1],
stapled_ocsp: Some(include_bytes!("root1-int1-ee_1-revoked.ocsp")),
Expand Down

0 comments on commit 45c360f

Please sign in to comment.