aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2023-01-14 20:51:00 +0400
committerJoursoir <chat@joursoir.net>2023-01-16 13:32:49 +0400
commitc6f82e94b37e1d36694cbc9ade5721d4afae9d5b (patch)
treeeb778cbada55f6c709a96a8d9d52d1eef7e5c9eb
parentd11b16a6dd59145a5fc43017b39ff0fb5f7788fc (diff)
downloadsbdd-c6f82e94b37e1d36694cbc9ade5721d4afae9d5b.tar.gz
sbdd-c6f82e94b37e1d36694cbc9ade5721d4afae9d5b.tar.bz2
sbdd-c6f82e94b37e1d36694cbc9ade5721d4afae9d5b.zip
makefile: introduce 2 simple testsHEADmq-offmaster
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7ecb2a3..b5c009d 100644
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,8 @@
######## Makefile
TARG_BLK = /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001
+SBDD_BLK = /dev/sbdd
+DD_ARGS = bs=512 count=1
default:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
@@ -51,3 +53,17 @@ unload:
dmesg -C
rmmod sbdd.ko
dmesg
+
+test1:
+ dd $(DD_ARGS) if=/dev/urandom of=$(SBDD_BLK)
+ blockdev --flushbufs $(TARG_BLK)
+ dd $(DD_ARGS) if=$(TARG_BLK) of=./drive.log
+ dd $(DD_ARGS) if=$(SBDD_BLK) of=./sbdd.log
+ diff ./sbdd.log ./drive.log
+
+test2:
+ dd $(DD_ARGS) if=/dev/urandom of=$(TARG_BLK)
+ dd $(DD_ARGS) if=$(TARG_BLK) of=./drive.log
+ dd $(DD_ARGS) if=$(SBDD_BLK) of=./sbdd.log
+ diff ./sbdd.log ./drive.log
+