| 2670 | |
| 2671 | #[test] |
| 2672 | fn no_backing_file() { |
| 2673 | // `backing_file` is `None` |
| 2674 | let header = QcowHeader::create_for_size_and_path(3, 0x10_0000, None) |
| 2675 | .expect("Failed to create header."); |
| 2676 | let mut disk_file: RawFile = RawFile::new(TempFile::new().unwrap().into_file(), false); |
| 2677 | header |
| 2678 | .write_to(&mut disk_file) |
| 2679 | .expect("Failed to write header to shm."); |
| 2680 | disk_file.rewind().unwrap(); |
| 2681 | // The maximum nesting depth is 0, which means backing file is not allowed. |
| 2682 | QcowFile::from_with_nesting_depth(disk_file, 0, true).unwrap(); |
| 2683 | } |
| 2684 | |
| 2685 | #[test] |
| 2686 | fn disable_backing_file() { |