feat: test if vhost is loaded into nginx
This commit is contained in:
parent
62278abede
commit
e7068cfc7c
1 changed files with 13 additions and 0 deletions
13
env/nginx_bind_le/src/lib.rs
vendored
13
env/nginx_bind_le/src/lib.rs
vendored
|
@ -59,6 +59,7 @@ impl Conductor for NginxBindLEConductor {
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use std::process::Stdio;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
@ -81,6 +82,18 @@ mod tests {
|
||||||
path: "/var/www/website/".into(),
|
path: "/var/www/website/".into(),
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
let out = tokio::process::Command::new("sudo")
|
||||||
|
.arg("nginx")
|
||||||
|
.arg("-T")
|
||||||
|
.stdout(Stdio::piped())
|
||||||
|
.output()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let expected = format!("server_name {HOSTNAME}");
|
||||||
|
let out = String::from_utf8(out.stdout).unwrap();
|
||||||
|
assert!(out.contains(&expected));
|
||||||
c.process(EventType::DeleteSite {
|
c.process(EventType::DeleteSite {
|
||||||
hostname: HOSTNAME.into(),
|
hostname: HOSTNAME.into(),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue