Skip to content

Commit

Permalink
builder: fix assertion error by explicitly specifying type when build…
Browse files Browse the repository at this point in the history
…ing nydus in macos arm64 environment.

Signed-off-by: hijackthe2 <2948278083@qq.com>
  • Loading branch information
hijackthe2 authored and jiangliu committed Nov 7, 2023
1 parent 89882a4 commit 002b2f2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions builder/src/stargz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,28 +991,28 @@ mod tests {
entry.toc_type = "dir".to_owned();
assert!(entry.is_dir());
assert!(entry.is_supported());
assert_eq!(entry.mode(), libc::S_IFDIR);
assert_eq!(entry.mode(), libc::S_IFDIR as u32);
assert_eq!(entry.rdev(), u32::MAX);

entry.toc_type = "req".to_owned();
assert!(!entry.is_reg());
entry.toc_type = "reg".to_owned();
assert!(entry.is_reg());
assert!(entry.is_supported());
assert_eq!(entry.mode(), libc::S_IFREG);
assert_eq!(entry.mode(), libc::S_IFREG as u32);
assert_eq!(entry.size(), 0x10);

entry.toc_type = "symlink".to_owned();
assert!(entry.is_symlink());
assert!(entry.is_supported());
assert_eq!(entry.mode(), libc::S_IFLNK);
assert_eq!(entry.mode(), libc::S_IFLNK as u32);
assert_eq!(entry.symlink_link_path(), Path::new("link_name"));
assert!(entry.normalize().is_ok());

entry.toc_type = "hardlink".to_owned();
assert!(entry.is_supported());
assert!(entry.is_hardlink());
assert_eq!(entry.mode(), libc::S_IFREG);
assert_eq!(entry.mode(), libc::S_IFREG as u32);
assert_eq!(entry.hardlink_link_path(), Path::new("link_name"));
assert!(entry.normalize().is_ok());

Expand All @@ -1026,18 +1026,18 @@ mod tests {
entry.toc_type = "block".to_owned();
assert!(entry.is_special());
assert!(entry.is_blockdev());
assert_eq!(entry.mode(), libc::S_IFBLK);
assert_eq!(entry.mode(), libc::S_IFBLK as u32);

entry.toc_type = "char".to_owned();
assert!(entry.is_special());
assert!(entry.is_chardev());
assert_eq!(entry.mode(), libc::S_IFCHR);
assert_eq!(entry.mode(), libc::S_IFCHR as u32);
assert_ne!(entry.size(), 0x10);

entry.toc_type = "fifo".to_owned();
assert!(entry.is_fifo());
assert!(entry.is_special());
assert_eq!(entry.mode(), libc::S_IFIFO);
assert_eq!(entry.mode(), libc::S_IFIFO as u32);
assert_eq!(entry.rdev(), 65313);

assert_eq!(entry.name().unwrap().to_str(), Some("all-entry-type.tar"));
Expand Down

0 comments on commit 002b2f2

Please sign in to comment.