Skip to content

Commit

Permalink
Removing a cert removes dependent rules - add test case for audited p…
Browse files Browse the repository at this point in the history
…ayload (#2625)

* add test case for audited payload

* formatting
  • Loading branch information
staszek-krotki authored Jun 19, 2023
1 parent 7a63e19 commit 9545813
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions agent/provider/tests/rule_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,13 @@ fn get_rule_mode<'a>(rules_list: &'a Value, rule: &'a str, cert_id: &'a str) ->
.map(|(_id, value)| &value["mode"])
}

#[test]
#[test_case("audited-payload", "foo_ca.cert.pem")]
#[test_case("partner", "partner-certificate.signed.json")]
#[serial_test::serial]
fn removing_cert_should_also_remove_its_rule() {
fn removing_cert_should_also_remove_its_rule(rule: &str, cert: &str) {
let (data_dir, resource_cert_dir) = prepare_test_dir_with_cert_resources();

let rule = "partner";

let cert_id = add_certificate_to_keystore(
data_dir.path(),
&resource_cert_dir,
"partner-certificate.signed.json",
);
let cert_id = add_certificate_to_keystore(data_dir.path(), &resource_cert_dir, cert);

Command::cargo_bin("ya-provider")
.unwrap()
Expand Down

0 comments on commit 9545813

Please sign in to comment.