From f11d2bc92185250ef15f3a93bcdf18575c61e21b Mon Sep 17 00:00:00 2001 From: hasslesstech Date: Sun, 1 Dec 2024 20:42:43 +0200 Subject: [PATCH] add script for automatic module insertion testing --- test.sh | 18 ++++++++++++++++++ tests/lab5-test | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 test.sh create mode 100644 tests/lab5-test diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..62febae --- /dev/null +++ b/test.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Error: no script supplied" + echo "Usage: $0 path/to/testing/script" + exit 1 +fi + +while read l; do + if [ -z "$l" ]; then + continue; + fi; + + echo "$ $l"; + $($l); + + echo -e "" +done < $1 diff --git a/tests/lab5-test b/tests/lab5-test new file mode 100644 index 0000000..fa082cb --- /dev/null +++ b/tests/lab5-test @@ -0,0 +1,33 @@ +insmod hello2.ko + +insmod hello1.ko + +insmod hello2.ko +rmmod hello2.ko + +insmod hello2.ko msg_count=0 +rmmod hello2.ko + +insmod hello2.ko msg_count=1 +rmmod hello2.ko + +insmod hello2.ko msg_count=3 +rmmod hello2.ko + +insmod hello2.ko msg_count=5 +rmmod hello2.ko + +insmod hello2.ko msg_count=8 +rmmod hello2.ko + +insmod hello2.ko msg_count=10 +rmmod hello2.ko + +insmod hello2.ko msg_count=12 +rmmod hello2.ko + +insmod hello2.ko +rmmod hello1.ko + +rmmod hello2.ko +rmmod hello1.ko