Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions tests/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,48 @@ fn service_should_be_started_successfully() {
client.verify_pod_condition(&pod, "Ready");
}

#[test]
fn host_ip_and_node_ip_should_be_set() {
let client = TestKubeClient::new();

setup_repository(&client);

let pod = TemporaryResource::new(
&client,
&with_unique_name(indoc! {"
apiVersion: v1
kind: Pod
metadata:
name: agent-service-integration-test-ip
spec:
containers:
- name: noop-service
image: noop-service:1.0.0
command:
- noop-service-1.0.0/start.sh
tolerations:
- key: kubernetes.io/arch
operator: Equal
value: stackable-linux
"}),
);

let are_host_ip_and_node_ip_set = |pod: &Pod| {
let host_ip = pod
.status
.as_ref()
.and_then(|status| status.host_ip.as_ref());
let pod_ip = pod
.status
.as_ref()
.and_then(|status| status.pod_ip.as_ref());

host_ip.is_some() && pod_ip.is_some() && host_ip == pod_ip
};

client.verify_status::<Pod, _>(&pod, are_host_ip_and_node_ip_set);
}

#[test]
fn restart_after_ungraceful_shutdown_should_succeed() {
// must be greater than the period between the deletion of the pod
Expand Down