From c6f82e94b37e1d36694cbc9ade5721d4afae9d5b Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sat, 14 Jan 2023 20:51:00 +0400 Subject: makefile: introduce 2 simple tests --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Makefile') 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 + -- cgit v1.2.3-18-g5258