# Rustbelt shell self-test: `cargo run --features headless` runs this with # `sh /mnt/disk0/scripts/selftest.sh` (B:/scripts/selftest.sh) and scripts/run-headless.sh checks the output. ver drives pwd cd B: ls ls -l notes type B:/readme.txt cat b:notes/todo.txt | grep -i EXT | wc -l dir bin | wc -l echo first line > A:/tmp/out.txt echo second line >> /tmp/out.txt cat < /tmp/out.txt md /tmp/work copy B:/notes/todo.txt /tmp/work touch /tmp/work/empty.txt ls -l A:/tmp/work del /tmp/work/todo.txt /tmp/work/empty.txt /tmp/work grep "B:" readme.txt alias ll="ls -l" ll A:/tmp run --trace cat B:/notes/todo.txt start sleep 1 jobs wait cd C: ls cat hello-link grep "line 12345" big.txt cp B:/notes/todo.txt C:/todo.txt cat C:/todo.txt | grep -i ext2 md C:/made-here echo written by Rustbelt > C:/made-here/note.txt type C:/made-here/note.txt ls -l C:/ cd D: ls cat "long file name with spaces.txt" cp B:/notes/todo.txt D:/ cp C:/hello.txt "Copied From Ext2.txt" cp mixedcase.txt C:/from-exfat.txt cat C:/from-exfat.txt md "New Folder" echo hi from exFAT > "New Folder/Note.txt" type "new folder/NOTE.TXT" ls -l D:/ cd E: ls -l cat hello.txt cat hello-link cat docs/btrfs/cow.txt wc big.txt grep "line 119999" big.txt cat projects/rustbelt/stage10.txt cp docs/btrfs/cow.txt D:/cow.txt type D:/COW.TXT | wc -l cp docs/btrfs/chunks.txt C:/chunks.txt cat C:/chunks.txt | wc -l echo hi > new.txt rm hello.txt mkdir newdir run evil # Stage 11: a stack overflow hits the guard zone and is killed cleanly; # then two CPU hogs in the background, and sysinfo shows the load per CPU. run overflow start spin start spin sysinfo wait # Stage 12: networking. DHCP gave us an address; ping QEMU's gateway; fetch # from the test web server QEMU runs for 10.0.2.100 (guestfwd), and save a # 108 KB file to D:; look up a name (only works if the host has DNS); then # serve one request with httpd (run-headless.sh curls it through hostfwd). ifconfig ping -c 3 -i 200 10.0.2.2 fetch http://10.0.2.100/ wget -o D:/seq.txt http://10.0.2.100/big cat D:/seq.txt | wc -l host example.com httpd -n 1 -t 20 nosuchprogram cd Q: cd A:/tmp pwd exit 0