Add support for arm32/integratorcp
[ci.git] / scenarios / base / fs.test
blob83b745a9ec86dba6a2c87f6e81e8a522378da3f8
2 xx_start_machine name=main
5 # Create empty file /tmp/img with reasonable size.
6 # We give it 3s for prompt to reappear and no error message to
7 # be printed (cmd checks for standard Bdsh error message by default).
8 xx_cmd "mkfile --size 2m /tmp/img" timeout=10
10 # Check that the created image is of right size.
11 # We issue a more descriptive error message if not. We leave the timeout
12 # here on default since ls ought to be pretty fast.
13 xx_cmd "ls /tmp" \
14     assert="2097152" \
15     error="Empty image file does not have the right size."
17 # Just for demonstration, we check the file size again, here with zero
18 # timeout as the text is already on the screen anyway.
19 xx_assert "2097152" message="Ooops" timeout=0
21 # Create block device on the file.
22 xx_cmd "file_bd /tmp/img fbd0" \
23     assert="Accepting connections" \
24     error="Failed to start block device layer." \
25     timeout=20
27 # Create filesystem there. We print a customized message when doing so.
28 xx_cmd \
29     "mkfat --type 12 fbd0" \
30     assert="Success" \
31     message="Creating FAT on the file-backed block device" \
32     error="Failed to create FAT file system" \
33     timeout=25
36 # Start the FAT file server
37 # No longer needed as all FS servers are started to
38 # allow FS probing
39 false && xx_cmd "fat" \
40     assert="Accepting connections" \
41     error="Failed to start FAT service." \
42     timeout=20
44 # Create a dedicated mountpoint
45 xx_cmd "mkdir /tmp/mnt" timeout=20 
47 # Mount the filesystem.
48 # Error in this command results in the word 'Unable' to appear on the screen.
49 xx_cmd "mount fat /tmp/mnt fbd0" die_on="Unable"
51 # Copy the file to the mounted filesystem.
52 xx_cmd "cp demo.txt /tmp/mnt" error="Copying demo.txt failed"
54 # Check that the file is copied there.
55 # We need to clear the screen as the word demo.txt was used in the previous
56 # command.
57 xx_cls
58 xx_cmd "ls /tmp/mnt" assert="demo.txt"
61 # Unmount the image, check the file is not there
62 xx_cls
63 xx_cmd "umount /tmp/mnt"
64 xx_cmd "ls /tmp/mnt" die_on="demo.txt" error="demo.txt is still there."
66 # Remount the image and check the file is still there (cls is needed again).
67 xx_cls
68 xx_cmd "mount fat /tmp/mnt fbd0" die_on="Unable"
69 xx_cmd "ls /tmp/mnt" assert="demo.txt" error="demo.txt disappeared from the FAT image."
72 # Not necessary, really.
73 xx_cmd "umount /tmp/mnt"
75 xx_stop_machine