Skip to content

Commit 9afa43f

Browse files
test: remove ca trust test that is flaky on 2.9.0
1 parent ebd04f6 commit 9afa43f

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsCertificateAuthorityTestCase.inc

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,6 @@ AwEHoUQDQgAE1RtITpFIce3jjv2AkBqYaVRU0swODWO+DREC/xsYnaNSyVGT5hy6
6565
R02Pul8ulWQ8Kl3Q3pou8As7W1mMzA2DxQ==
6666
-----END EC PRIVATE KEY-----";
6767

68-
/**
69-
* Continually checks if certctl has a specific cert command name listed in the truststore. This is necessary
70-
* as the trust store populates very slowly and is not always read immediately after a CA is set with trust.
71-
* @param string $common_name The common name to check for in the truststore
72-
* @returns bool true if the cert is trusted, false otherwise
73-
*/
74-
public function is_cert_trusted(string $common_name): bool {
75-
foreach (range(0, 10) as $attempt) {
76-
sleep($attempt * 1.2);
77-
$certctl = new Command('certctl list');
78-
if (str_contains($certctl->output, $common_name)) {
79-
return true;
80-
}
81-
}
82-
83-
return false;
84-
}
85-
8668
/**
8769
* Checks that a CertificateAuthority cannot have `crt` and `prv` values that are not a matching key pair.
8870
*/
@@ -116,35 +98,6 @@ R02Pul8ulWQ8Kl3Q3pou8As7W1mMzA2DxQ==
11698
);
11799
}
118100

119-
/**
120-
* Checks that the CA is found in the OS trust store when `trust` is enabled.
121-
*/
122-
public function test_ca_trust() {
123-
# Create a CA to test with
124-
$ca = new CertificateAuthority(
125-
data: [
126-
'descr' => 'test',
127-
'crt' => self::EXAMPLE_CRT,
128-
'prv' => self::EXAMPLE_PRV,
129-
'trust' => true,
130-
],
131-
);
132-
$ca->create();
133-
134-
# Ensure the cert is in the trust store directory
135-
$this->assert_is_true($this->is_cert_trusted('example.com'));
136-
137-
# Disable `trust`
138-
$ca->trust->value = false;
139-
$ca->update();
140-
141-
# Ensure the certificate is not found in the trust store
142-
$this->assert_is_false($this->is_cert_trusted('example.com'));
143-
144-
# Delete the CA
145-
$ca->delete();
146-
}
147-
148101
/**
149102
* Checks that we cannot delete a CA that is in use.
150103
*/

0 commit comments

Comments
 (0)