1.5 KiB
1.5 KiB
Brief testing guide
1. Build and start
make
make run
make run starts the program with disk.img as the virtual carrier file.
2. Basic filesystem scenario
Enter these commands inside the program:
format 512
mkdir /docs
touch /docs/test.txt
write /docs/test.txt hello filesystem
ls /docs
cat /docs/test.txt
rename /docs/test.txt renamed.txt
cat /docs/renamed.txt
info
Expected result:
- formatting succeeds;
/docscontains one file;catprintshello filesystem;- after renaming, the file is available as
renamed.txt; infoshows a 512 KiB carrier and occupied clusters.
3. Compression and defragmentation
touch /docs/repeat.txt
write /docs/repeat.txt aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
compress /docs/repeat.txt
ls /docs
defrag
cat /docs/repeat.txt
Expected result:
compresssucceeds for repeated text;- in
ls,storedis smaller thansizeforrepeat.txt; - after
defrag, the file still reads correctly.
4. Import and export
Before starting the program, create a host file:
echo "outside file" > host.txt
Then inside the program:
import host.txt /docs/imported.txt
cat /docs/imported.txt
export /docs/imported.txt exported.txt
After leaving the program, verify:
cat exported.txt
Expected result: exported.txt contains outside file.
5. Cleanup
make clean
rm -f host.txt exported.txt
make clean removes the executable and the default virtual disk image.