make zlint be less stupid about the domains its processing

Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
Erik Hollensbe
2022-02-18 08:04:25 -08:00
parent 1167e36ead
commit ea4660f6ed
2 changed files with 11 additions and 7 deletions
+2 -2
View File
@@ -653,7 +653,7 @@ mod tests {
assert_that!(res).is_ok();
}
assert_that!(srv.zlint(dir.clone()).await).is_ok();
assert_that!(srv.zlint("foo.com", dir.clone()).await).is_ok();
}
}
@@ -698,7 +698,7 @@ mod tests {
assert_that!(res).is_ok();
}
assert_that!(srv.zlint(dir.clone()).await).is_ok();
assert_that!(srv.zlint(domain, dir.clone()).await).is_ok();
}
}
}
+9 -5
View File
@@ -275,7 +275,11 @@ impl TestService {
}
}
pub(crate) async fn zlint(&self, certs: Arc<TempDir>) -> Result<(), ContainerError> {
pub(crate) async fn zlint(
&self,
domain: &str,
certs: Arc<TempDir>,
) -> Result<(), ContainerError> {
log::info!("letsencrypt dir: {}", certs.path().display());
let name = &format!("zlint-{}", short_hash(make_nonce(None)));
@@ -292,10 +296,10 @@ impl TestService {
.map(|c| c.to_string())
.collect::<Vec<String>>(),
),
cmd: Some(vec![
"set -e; for file in /etc/letsencrypt/live/*/fullchain.pem; do zlint $file; done"
.to_string(),
]),
cmd: Some(vec![format!(
"zlint /etc/letsencrypt/live/{}/fullchain.pem",
domain
)]),
host_config: Some(HostConfig {
binds: Some(vec![format!(
"{}:{}",