summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2013-04-15 14:52:17 -0400
committerBill Peck <bpeck@redhat.com>2013-04-15 14:52:17 -0400
commitdc53ea12cc09dafa5bef893ca805386e4ce8965c (patch)
tree5bf15fbbdc14d828e3f3d2136cd5bed64a3688f6
parenteb08043f98b749399d0edc7ad48f83c46dd95c34 (diff)
downloadtests-dc53ea12cc09dafa5bef893ca805386e4ce8965c.tar.gz
tests-dc53ea12cc09dafa5bef893ca805386e4ce8965c.tar.xz
tests-dc53ea12cc09dafa5bef893ca805386e4ce8965c.zip
test case for 949568
-rw-r--r--kernel/modules/949568/Makefile73
-rw-r--r--kernel/modules/949568/PURPOSE1
-rw-r--r--kernel/modules/949568/module0/Makefile8
-rw-r--r--kernel/modules/949568/module0/module0.c22
-rw-r--r--kernel/modules/949568/module1/Makefile8
-rw-r--r--kernel/modules/949568/module1/module1.c22
-rw-r--r--kernel/modules/949568/module2/Makefile8
-rw-r--r--kernel/modules/949568/module2/module2.c16
-rwxr-xr-xkernel/modules/949568/runtest.sh29
9 files changed, 187 insertions, 0 deletions
diff --git a/kernel/modules/949568/Makefile b/kernel/modules/949568/Makefile
new file mode 100644
index 0000000..6fec495
--- /dev/null
+++ b/kernel/modules/949568/Makefile
@@ -0,0 +1,73 @@
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Chao Ye <cye@redhat.com>
+
+# The toplevel namespace within which the test lives.
+TOPLEVEL_NAMESPACE=/kernel
+
+# The name of the package under test:
+PACKAGE_NAME=modules
+
+# The path of the test below the package:
+RELATIVE_PATH=949568
+
+# Version of the Test. Used with make tag.
+export TESTVERSION=1.0
+
+# The combined namespace of the test.
+export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
+
+
+# A phony target is one that is not really the name of a file.
+# It is just a name for some commands to be executed when you
+# make an explicit request. There are two reasons to use a
+# phony target: to avoid a conflict with a file of the same
+# name, and to improve performance.
+.PHONY: all install download clean
+
+# executables to be built should be added here, they will be generated on the system under test.
+BUILT_FILES=
+
+# data files, .c files, scripts anything needed to either compile the test and/or run it.
+FILES=$(METADATA) runtest.sh Makefile PURPOSE module0/module0.c module1/module1.c\
+ module2/module2.c
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+x ./runtest.sh
+
+clean:
+ rm -f *~ *.rpm $(BUILT_FILES)
+
+# You may need to add other targets e.g. to build executables from source code
+# Add them here:
+
+
+# Include Common Makefile
+include /usr/share/rhts/lib/rhts-make.include
+
+# Generate the testinfo.desc here:
+$(METADATA): Makefile
+ @touch $(METADATA)
+ @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
+ @echo "Name: $(TEST)" >> $(METADATA)
+ @echo "Path: $(TEST_DIR)" >> $(METADATA)
+ @echo "License: GPLv3" >> $(METADATA)
+ @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
+ @echo "Description: Regression test for Bug 949568">> $(METADATA)
+ @echo "TestTime: 5m" >> $(METADATA)
+ @echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
+ @echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
diff --git a/kernel/modules/949568/PURPOSE b/kernel/modules/949568/PURPOSE
new file mode 100644
index 0000000..f83c5ed
--- /dev/null
+++ b/kernel/modules/949568/PURPOSE
@@ -0,0 +1 @@
+Regression test for Bug 602033. This test is not 100% automation, you need you check console output to get the result.
diff --git a/kernel/modules/949568/module0/Makefile b/kernel/modules/949568/module0/Makefile
new file mode 100644
index 0000000..60003b5
--- /dev/null
+++ b/kernel/modules/949568/module0/Makefile
@@ -0,0 +1,8 @@
+obj-m := module0.o
+KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+clean:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
diff --git a/kernel/modules/949568/module0/module0.c b/kernel/modules/949568/module0/module0.c
new file mode 100644
index 0000000..b721dd7
--- /dev/null
+++ b/kernel/modules/949568/module0/module0.c
@@ -0,0 +1,22 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+MODULE_LICENSE("Dual BSD/GPL");
+
+static int module0_init(void)
+{
+ int code = 0;
+ printk(KERN_INFO "Module0 loaded!\n");
+ code = request_module("module1");
+ if (code != 0)
+ printk(KERN_ERR "Request module1 failed\n");
+ else
+ printk(KERN_INFO "Request module1 successed\n");
+ return 0;
+}
+static void module0_exit(void)
+{
+ printk(KERN_ALERT "module0 removed\n");
+}
+module_init(module0_init);
+module_exit(module0_exit);
diff --git a/kernel/modules/949568/module1/Makefile b/kernel/modules/949568/module1/Makefile
new file mode 100644
index 0000000..12e2918
--- /dev/null
+++ b/kernel/modules/949568/module1/Makefile
@@ -0,0 +1,8 @@
+obj-m := module1.o
+KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+clean:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
diff --git a/kernel/modules/949568/module1/module1.c b/kernel/modules/949568/module1/module1.c
new file mode 100644
index 0000000..f01e9dc
--- /dev/null
+++ b/kernel/modules/949568/module1/module1.c
@@ -0,0 +1,22 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+MODULE_LICENSE("Dual BSD/GPL");
+
+static int module1_init(void)
+{
+ int code = 0;
+ printk(KERN_INFO "module1 loaded!\n");
+ code = request_module("module2");
+ if (code != 0)
+ printk(KERN_ERR "Request module2 failed\n");
+ else
+ printk(KERN_INFO "Request module2 successed\n");
+ return 0;
+}
+static void module1_exit(void)
+{
+ printk(KERN_ALERT "module1 removed\n");
+}
+module_init(module1_init);
+module_exit(module1_exit);
diff --git a/kernel/modules/949568/module2/Makefile b/kernel/modules/949568/module2/Makefile
new file mode 100644
index 0000000..0a7a5f3
--- /dev/null
+++ b/kernel/modules/949568/module2/Makefile
@@ -0,0 +1,8 @@
+obj-m := module2.o
+KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+clean:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
diff --git a/kernel/modules/949568/module2/module2.c b/kernel/modules/949568/module2/module2.c
new file mode 100644
index 0000000..3f22de1
--- /dev/null
+++ b/kernel/modules/949568/module2/module2.c
@@ -0,0 +1,16 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+MODULE_LICENSE("Dual BSD/GPL");
+
+static int module2_init(void)
+{
+ printk(KERN_INFO "module2 loaded!\n");
+ return 0;
+}
+static void module2_exit(void)
+{
+ printk(KERN_ALERT "module2 removed\n");
+}
+module_init(module2_init);
+module_exit(module2_exit);
diff --git a/kernel/modules/949568/runtest.sh b/kernel/modules/949568/runtest.sh
new file mode 100755
index 0000000..9841a13
--- /dev/null
+++ b/kernel/modules/949568/runtest.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Bill Peck <bpeck@redhat.com>
+
+# Source the common test script helpers
+. /usr/bin/rhts_environment.sh
+
+make -C module0
+make -C module1
+make -C module2
+cp module0/module0.ko /lib/modules/$(uname -r)
+cp module1/module1.ko /lib/modules/$(uname -r)
+cp module2/module2.ko /lib/modules/$(uname -r)
+depmod -a
+modprobe module0
+report_result "${TEST}" "PASS"