Skip to content

Commit

Permalink
kbs_protocol: skip RCAR client tests when ProtocolVersion error occurs
Browse files Browse the repository at this point in the history
The current setup with trustee repo for KBS server and guest-components
repo for kbs_protocol client code has a cyclic dependency problem.

test_client test uses "KBS latest" container image which won't work if
any RCAR client code changes that change the protocol semantics are made.

The suggest approach to break the cyclic dependency is to get the RCAR
client changes merged first with a KBS protocol version bump. The
test_client tests are modified to skip the tests in case the "KBS
latest" server returns ProtocolVersion error.

Following this, the corresponding KBS server changes are made in trustee
repo with an update to kbs_protocol for kbs-client builds and the server
supported protocol version.

Signed-off-by: Mikko Ylinen <[email protected]>
  • Loading branch information
mythi committed Jul 31, 2024
1 parent d316de2 commit 3b3aedb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions attestation-agent/kbs_protocol/src/client/rcar_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,19 @@ mod test {
.try_into()
.expect("resource uri");

let resource = client
.get_resource(resource_uri)
.await
.expect("get resource");
let resource = match client.get_resource(resource_uri).await {
Ok(resource) => resource,
Err(e) => {
// Skip the test if the kbs server returned ProtocolVersion error. Any other
// error is treated as a failure.
assert!(e
.to_string()
.contains("KBS Client Protocol Version Mismatch"));
println!("NOTE: the test is skipped due to KBS protocol incompatibility.");
return ();
}
};

assert_eq!(resource, CONTENT);

let (token, key) = client.get_token().await.expect("get token");
Expand Down

0 comments on commit 3b3aedb

Please sign in to comment.