Compare commits
2 Commits
357501f549
...
504ceeec87
| Author | SHA1 | Date | |
|---|---|---|---|
| 504ceeec87 | |||
| cbf697bcd5 |
+13
-4
@@ -402,15 +402,24 @@ mod tests {
|
||||
|
||||
/// A shadowed hostname must not be counted as a reason to expect failure.
|
||||
/// This is the exact case the first version got wrong.
|
||||
///
|
||||
/// Asserts the hostname check itself rather than counting states across the
|
||||
/// whole run: `backend_reachable` opens real sockets, so an aggregate count
|
||||
/// silently asserts that THIS machine has the OpenFUT ports open. That made
|
||||
/// the test pass only on the server host and fail on the game machine, which
|
||||
/// is precisely where someone building the launcher runs the suite.
|
||||
#[test]
|
||||
fn a_shadowed_hostname_is_a_warning_not_a_failure() {
|
||||
let mut c = cfg();
|
||||
c.openfut_server_host = "127.0.0.2".into();
|
||||
c.ea_hostnames = vec!["localhost".into()];
|
||||
c.fifa17_tools_dir = "/nonexistent/openfut-tools".into();
|
||||
let checks = run(&c);
|
||||
assert_eq!(failures(&checks), 0, "must not be reported as fatal");
|
||||
assert_eq!(warnings(&checks), 1);
|
||||
let check = hostname_mapping(&c);
|
||||
assert_eq!(check.state, State::Warn, "{}", check.detail);
|
||||
assert!(
|
||||
check.detail.contains("localhost"),
|
||||
"the warning must name the shadowed host: {}",
|
||||
check.detail
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user