Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builder: fix assertion error #1471

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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