code: mafs

Download patch

ref: 34b6e3f626d9c4e0671b942ed304d5f0adab86bb
parent: 4d8019c4f7efa8548d743bbbb907f58c67203daf
author: 9ferno <gophone2015@gmail.com>
date: Tue Nov 29 06:14:36 EST 2022

added a flush test

diff: cannot open b/tests/flush//null: file does not exist: 'b/tests/flush//null'
--- /dev/null
+++ b/tests/chkflush.rc
@@ -1,0 +1,21 @@
+#!/bin/rc
+
+# test flush and sync
+
+dd -if /dev/zero -of flush/disk -bs 512 -count 64
+mount -c <{disk/mafs -s -r test.flush flush/disk <[0=1]} /n/mfs_test.flush
+> /n/mfs_test.flush/4blocks.file {
+	# cat /n/mfs_test.flush/adm/ctl >/tmp//test.flush.file
+	cat flush/2_blocks.file
+	sleep 15
+	cat flush/2_blocks.file
+	sleep 15
+}
+# cat /tmp//test.flush.file
+# cat /n/mfs_test.flush/adm/ctl
+echo sync >> /n/mfs_test.flush/adm/ctl
+cat /n/mfs_test.flush/adm/ctl
+sleep 1
+echo '-------sending halt------------'
+echo halt >> /n/mfs_test.flush/adm/ctl
+
--- /dev/null
+++ b/tests/flush/2_blocks.file
@@ -1,0 +1,74 @@
+0 0123456789
+1 0123456789
+2 0123456789
+3 0123456789
+4 0123456789
+5 0123456789
+6 0123456789
+7 0123456789
+8 0123456789
+9 0123456789
+10 0123456789
+11 0123456789
+12 0123456789
+13 0123456789
+14 0123456789
+15 0123456789
+16 0123456789
+17 0123456789
+18 0123456789
+19 0123456789
+20 0123456789
+21 0123456789
+22 0123456789
+23 0123456789
+24 0123456789
+25 0123456789
+26 0123456789
+27 0123456789
+28 0123456789
+29 0123456789
+30 0123456789
+31 0123456789
+32 0123456789
+33 0123456789
+34 0123456789
+35 0123456789
+36 0123456789
+37 0123456789
+38 0123456789
+39 0123456789
+40 0123456789
+41 0123456789
+42 0123456789
+43 0123456789
+44 0123456789
+45 0123456789
+46 0123456789
+47 0123456789
+48 0123456789
+49 0123456789
+50 0123456789
+51 0123456789
+52 0123456789
+53 0123456789
+54 0123456789
+55 0123456789
+56 0123456789
+57 0123456789
+58 0123456789
+59 0123456789
+60 0123456789
+61 0123456789
+62 0123456789
+63 0123456789
+64 0123456789
+65 0123456789
+66 0123456789
+67 0123456789
+68 0123456789
+69 0123456789
+70 0123456789
+71 0123456789
+72 0123456789
+73 012345678
binary files /dev/null b/tests/flush/disk differ