]> git.proxmox.com Git - proxmox-backup.git/blobdiff - tests/pxar.rs
unbreak build
[proxmox-backup.git] / tests / pxar.rs
index 8e66a4c9afe282d50aee2a98f73f9a87683b6d4e..cdb25e3fde5c607cfa6f151089d0265bd2847ac8 100644 (file)
@@ -24,26 +24,25 @@ fn pxar_create_and_extract() {
             panic!("Failed to invoke '{}': {}", exec_path, err)
         });
 
+    println!("run '{} extract archive.pxar {}'", exec_path, dest_dir);
+
     Command::new(exec_path)
         .arg("extract")
         .arg("./tests/archive.pxar")
+        .arg("--target")
         .arg(dest_dir)
         .status()
         .unwrap_or_else(|err| {
             panic!("Failed to invoke '{}': {}", exec_path, err)
         });
 
+    println!("run 'rsync --dry-run --itemize-changes --archive {} {}' to verify'", src_dir, dest_dir);
     /* Use rsync with --dry-run and --itemize-changes to compare
        src_dir and dest_dir */
     let stdout = Command::new("rsync")
         .arg("--dry-run")
         .arg("--itemize-changes")
-        .arg("--recursive")
-        .arg("--acls")
-        .arg("--xattrs")
-        .arg("--owner")
-        .arg("--group")
-        .arg("--hard-links")
+        .arg("--archive")
         .arg(src_dir)
         .arg(dest_dir)
         .stdout(Stdio::piped())
@@ -53,7 +52,12 @@ fn pxar_create_and_extract() {
         .unwrap();
 
     let reader = BufReader::new(stdout);
-    let linecount = reader.lines().fold(0, |count, _| count + 1 );
+    let mut line_iter = reader.lines().map(|l| l.unwrap());
+    let mut linecount = 0;
+    while let Some(curr) = line_iter.next() {
+        println!("{}", curr);
+        linecount += 1;
+    }
     println!("Rsync listed {} differences to address", linecount);
 
     // Cleanup archive