|
From: Cyril H. <su...@li...> - 2013-09-10 12:51:22
|
The branch, master, has been updated
via 372fbd2416fd02b205690443f93e609c462b409e (commit)
via f6c0e345365811dd667646548ecda722f899993e (commit)
via 473b8cf5d6a40a46fcb2e082437ac7fdc5a3db96 (commit)
via 7d7904eec92d4a7493897c1b87799a494cefcb96 (commit)
via ed49c1a0a485d278a469a3236351b3af5405a24c (commit)
via 189c4419610af11c31685b4ed1ffda154cbf4f4b (commit)
from 0f3ac8c323de141fb2d3fb4339819ee117e58124 (commit)
- Log -----------------------------------------------------------------
commit 372fbd2416fd02b205690443f93e609c462b409e
Author: Alexey Kodanev <ale...@or...>
Date: Tue Sep 10 13:05:01 2013 +0400
device-drivers: rtc: enable the test to build and run
Signed-off-by: Alexey Kodanev <ale...@or...>
Signed-off-by: Cyril Hrubis <ch...@su...>
commit f6c0e345365811dd667646548ecda722f899993e
Author: Cyril Hrubis <ch...@su...>
Date: Tue Sep 10 14:41:17 2013 +0200
device-drivers: rename rtc-test to rtc01
So that the binary name matches the test name (TCID).
Signed-off-by: Cyril Hrubis <ch...@su...>
commit 473b8cf5d6a40a46fcb2e082437ac7fdc5a3db96
Author: Alexey Kodanev <ale...@or...>
Date: Mon Sep 9 16:23:01 2013 +0400
device-drivers: rtc: minor updates
Makefile updated.
Added .gitignore file.
Added root check and rtc device check.
Signed-off-by: Alexey Kodanev <ale...@or...>
commit 7d7904eec92d4a7493897c1b87799a494cefcb96
Author: Alexey Kodanev <ale...@or...>
Date: Tue Sep 10 12:14:50 2013 +0400
device-drivers: include device-drivers directory to the LTP build
Signed-off-by: Alexey Kodanev <ale...@or...>
commit ed49c1a0a485d278a469a3236351b3af5405a24c
Author: Alexey Kodanev <ale...@or...>
Date: Tue Sep 10 12:14:49 2013 +0400
device-drivers: add makefile to build drivers
Signed-off-by: Alexey Kodanev <ale...@or...>
commit 189c4419610af11c31685b4ed1ffda154cbf4f4b
Author: DAN LI <li...@cn...>
Date: Tue Sep 10 10:53:34 2013 +0800
runltp: bigger the supplied block device
To make a xfs filesystem, we need the device gets at least 4096 blocks.
Signed-off-by: DAN LI <li...@cn...>
Acked-by: Cyril Hrubis <ch...@su...>
-----------------------------------------------------------------------
Summary of changes:
runltp | 4 +-
runtest/kernel_misc | 1 +
testcases/kernel/Makefile | 1 +
.../fw_load_user => device-drivers}/Makefile | 9 +++--
testcases/kernel/device-drivers/rtc/.gitignore | 1 +
testcases/kernel/device-drivers/rtc/Makefile | 39 ++++++++------------
.../device-drivers/rtc/{rtc-test.c => rtc01.c} | 32 ++++++++++++++---
7 files changed, 53 insertions(+), 34 deletions(-)
copy testcases/kernel/{firmware/fw_load_user => device-drivers}/Makefile (84%)
create mode 100644 testcases/kernel/device-drivers/rtc/.gitignore
rename testcases/kernel/device-drivers/rtc/{rtc-test.c => rtc01.c} (89%)
diff --git a/runltp b/runltp
index e86f5c7..63c625f 100755
--- a/runltp
+++ b/runltp
@@ -955,8 +955,8 @@ main()
create_block()
{
- #create a block device with ext4 filesystem.
- dd if=/dev/zero of=${TMP}/test.img bs=1kB count=10240
+ #create a block device
+ dd if=/dev/zero of=${TMP}/test.img bs=1kB count=20480
if [ $? -ne 0 ]; then
echo "Failed to create loopback device image, please check disk space and re-run"
return 1
diff --git a/runtest/kernel_misc b/runtest/kernel_misc
index 73e21a7..29071b3 100644
--- a/runtest/kernel_misc
+++ b/runtest/kernel_misc
@@ -1,2 +1,3 @@
kmsg01 kmsg01
fw_load fw_load
+rtc01 rtc01
diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index 811fcca..fa6a191 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -38,6 +38,7 @@ ifneq ($(UCLINUX),1)
SUBDIRS += connectors \
containers \
controllers \
+ device-drivers \
firmware \
fs \
hotplug \
diff --git a/testcases/kernel/firmware/fw_load_user/Makefile b/testcases/kernel/device-drivers/Makefile
similarity index 84%
copy from testcases/kernel/firmware/fw_load_user/Makefile
copy to testcases/kernel/device-drivers/Makefile
index effd5da..62005c2 100644
--- a/testcases/kernel/firmware/fw_load_user/Makefile
+++ b/testcases/kernel/device-drivers/Makefile
@@ -14,7 +14,10 @@
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-top_srcdir ?= ../../../..
+top_srcdir ?= ../../..
-include $(top_srcdir)/include/mk/testcases.mk
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
+include $(top_srcdir)/include/mk/env_pre.mk
+
+SUBDIRS := rtc \
+
+include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/kernel/device-drivers/rtc/.gitignore b/testcases/kernel/device-drivers/rtc/.gitignore
new file mode 100644
index 0000000..727656a
--- /dev/null
+++ b/testcases/kernel/device-drivers/rtc/.gitignore
@@ -0,0 +1 @@
+/rtc-test
diff --git a/testcases/kernel/device-drivers/rtc/Makefile b/testcases/kernel/device-drivers/rtc/Makefile
index 0eefcb0..effd5da 100644
--- a/testcases/kernel/device-drivers/rtc/Makefile
+++ b/testcases/kernel/device-drivers/rtc/Makefile
@@ -1,29 +1,20 @@
+# Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
#
-# Copyright (c) Larsen & Toubro Infotech Ltd., 2010
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# This program is distributed in the hope that it would 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.
#
-# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-
-CFLAGS = -O2 -Wall -I ../../../../include/
-LIBS = -L ../../../../lib/ -lltp
-SRC = rtc-test.c
-
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-all: $(SRC)
- $(CC) $(SRC) $(CFLAGS) $(LIBS) -o rtc-test
+top_srcdir ?= ../../../..
-clean:
- rm -f rtc-test
+include $(top_srcdir)/include/mk/testcases.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/device-drivers/rtc/rtc-test.c b/testcases/kernel/device-drivers/rtc/rtc01.c
similarity index 89%
rename from testcases/kernel/device-drivers/rtc/rtc-test.c
rename to testcases/kernel/device-drivers/rtc/rtc01.c
index 28c1113..aa931f5 100644
--- a/testcases/kernel/device-drivers/rtc/rtc-test.c
+++ b/testcases/kernel/device-drivers/rtc/rtc01.c
@@ -3,6 +3,7 @@
* Tests for the Real Time Clock driver.
*
* Copyright (c) Larsen & Toubro Infotech Ltd., 2010
+ * Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
*
* Author : Silesh C V <Sil...@ln...>
*
@@ -21,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "test.h"
+
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -31,10 +32,26 @@
#include <errno.h>
#include <time.h>
+#include "test.h"
+#include "usctest.h"
+
int rtc_fd = -1;
char *TCID = "rtc01";
int TST_TOTAL = 3;
+static char *rtc_dev = "/dev/rtc";
+static int dflag;
+static const option_t options[] = {
+ {"d:", &dflag, &rtc_dev},
+ {NULL, NULL, NULL}
+};
+
+static void help(void)
+{
+ printf(" -d x rtc device node, default is %s\n",
+ rtc_dev);
+}
+
/* Read and Alarm Tests : Read test reads the Date/time from RTC
* while Alarm test, sets the alarm to 5 seconds in future and
* waits for it to ring.The ioctls tested in these tests are
@@ -192,12 +209,17 @@ void update_interrupts_test(void)
tst_resm(TPASS, "RTC UPDATE INTERRUPTS TEST Passed");
}
-int main(int argc, char **argv)
+int main(int argc, char *argv[])
{
- char *rtc_dev = "/dev/rtc";
+ char *msg;
+ msg = parse_opts(argc, argv, options, help);
+ if (msg != NULL)
+ tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
+
+ tst_require_root(NULL);
- if (argc == 2)
- rtc_dev = argv[1];
+ if (access(rtc_dev, F_OK) == -1)
+ tst_brkm(TCONF, NULL, "couldn't find rtc device '%s'", rtc_dev);
rtc_fd = open(rtc_dev, O_RDONLY);
hooks/post-receive
--
ltp
|