pulled out tests and validated them
This commit is contained in:
1 parent
dc8d62da30
commit
435a54a02d
67 files changed
+6927
-6957
No files matched your search
@@ -0,0 +1,28 @@
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn fakes_behave() {
|
||||
let st = fake_state(Config::default());
|
||||
assert_eq!(
|
||||
st.systemd.list_units(Some("failed")).await.unwrap().len(),
|
||||
1
|
||||
);
|
||||
assert!(matches!(
|
||||
st.systemd.unit_status("nope.service").await,
|
||||
Err(AppError::NotFound(_))
|
||||
));
|
||||
let q = JournalQuery {
|
||||
priority: Some(Priority::Err),
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(st.journal.query(&q).await.unwrap().len(), 2);
|
||||
assert_eq!(st.docker.ps(false).await.unwrap().len(), 2);
|
||||
let mut rx = st
|
||||
.docker
|
||||
.follow_logs("web", &LogOptions::default())
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(rx.recv().await.is_some());
|
||||
st.shutdown.cancel();
|
||||
while rx.recv().await.is_some() {}
|
||||
}
|
||||
Reference in new issue
Block a user