test(add): implicit dir

This commit is contained in:
grimhilt
2024-03-10 17:29:50 +01:00
parent 34dee1ceb6
commit fa65b6b071
4 changed files with 45 additions and 19 deletions

View File

@@ -13,7 +13,6 @@ pub struct ClientTest {
impl ClientTest {
pub fn new(id: String) -> Self {
// create a directory in /tmp with the given id
let mut vol = String::from("/tmp/");
vol.push_str(&id);
@@ -56,6 +55,7 @@ impl ClientTest {
pub fn run_cmd_ok(&mut self, args: &str) -> Output {
let output = self.run_cmd(args);
if !output.status.success() {
println!("id: {}", self.test_id.clone());
println!("Failed to execute: '{}'", args);
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));

View File

@@ -93,6 +93,7 @@ impl ServerTest {
let full_path = self.volume.clone().join(file);
if !full_path.exists() {
println!("id: {}", self.test_id.clone());
eprintln!("File '{}' doesn't exists on the server", file);
return false;
}
@@ -101,6 +102,7 @@ impl ServerTest {
for line in BufReader::new(f).lines(){
if let Ok(line) = line {
if line != content {
println!("id: {}", self.test_id.clone());
eprintln!("File '{}' is not equal, {} != {}", file, line, content);
return false;
}