summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2009-11-30 12:41:10 +0000
committerThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2009-11-30 12:41:10 +0000
commitf9925bcc246e3d923259d5816d9bfe8f1d0714fd (patch)
treed34cb9aa320d8c14d308cb0e2393936ab62be3ba /testsuites
parentdocumentation fixes (diff)
downloadrtems-f9925bcc246e3d923259d5816d9bfe8f1d0714fd.tar.bz2
added documentation
corrections in block tests added Makefile.am
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/libtests/ChangeLog11
-rw-r--r--testsuites/libtests/block01/Makefile.am2
-rw-r--r--testsuites/libtests/block01/block01.doc32
-rw-r--r--testsuites/libtests/block01/init.c4
-rw-r--r--testsuites/libtests/block02/Makefile.am2
-rw-r--r--testsuites/libtests/block02/block02.doc26
-rw-r--r--testsuites/libtests/block03/Makefile.am2
-rw-r--r--testsuites/libtests/block03/block03.doc26
-rw-r--r--testsuites/libtests/block04/Makefile.am2
-rw-r--r--testsuites/libtests/block04/block04.doc31
-rw-r--r--testsuites/libtests/block05/Makefile.am2
-rw-r--r--testsuites/libtests/block05/block05.doc44
-rw-r--r--testsuites/libtests/block05/init.c64
-rw-r--r--testsuites/libtests/block06/Makefile.am2
-rw-r--r--testsuites/libtests/block06/block06.doc21
-rw-r--r--testsuites/libtests/block07/Makefile.am2
-rw-r--r--testsuites/libtests/block07/block07.doc26
17 files changed, 280 insertions, 19 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog
index d89a0a1ced..90d79be1db 100644
--- a/testsuites/libtests/ChangeLog
+++ b/testsuites/libtests/ChangeLog
@@ -1,3 +1,14 @@
+2009-11-30 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
+
+ * block05/init.c: Check block size. Improved output.
+ * block01/init.c: Free ramdisk before exit.
+ * block01/block01.doc, block02/block02.doc, block03/block03.doc,
+ block04/block04.doc, block05/block05.doc, block06/block06.doc,
+ block07/block07.doc: New files.
+ * block01/Makefile.am, block02/Makefile.am, block03/Makefile.am,
+ block04/Makefile.am, block05/Makefile.am, block06/Makefile.am,
+ block07/Makefile.am: Add new files.
+
2009-11-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* block02/.cvsignore, block03/.cvsignore, block04/.cvsignore,
diff --git a/testsuites/libtests/block01/Makefile.am b/testsuites/libtests/block01/Makefile.am
index b7f5565b5c..653969a26d 100644
--- a/testsuites/libtests/block01/Makefile.am
+++ b/testsuites/libtests/block01/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block01
block01_SOURCES = init.c
-dist_rtems_tests_DATA = block01.scn
+dist_rtems_tests_DATA = block01.scn block01.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block01/block01.doc b/testsuites/libtests/block01/block01.doc
new file mode 100644
index 0000000000..34a7ad7ab7
--- /dev/null
+++ b/testsuites/libtests/block01/block01.doc
@@ -0,0 +1,32 @@
+#
+# $Id$
+#
+# Copyright (c) 2009
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# D-82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block01
+
+directives:
+
+ rtems_disk_create_log
+ rtems_disk_create_phys
+ rtems_disk_delete
+ rtems_disk_io_done
+ rtems_disk_io_initialize
+ rtems_disk_release
+
+concepts:
+
++ Check error conditions.
++ Create and delete physical and logical disks.
diff --git a/testsuites/libtests/block01/init.c b/testsuites/libtests/block01/init.c
index 4f9b831ae7..067f883738 100644
--- a/testsuites/libtests/block01/init.c
+++ b/testsuites/libtests/block01/init.c
@@ -17,6 +17,8 @@
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
*/
#include <stdio.h>
@@ -153,6 +155,8 @@ static void test_diskdevs(void)
sc = rtems_io_unregister_driver(major);
ASSERT_SC(sc);
+ ramdisk_free(rd);
+
sc = rtems_disk_io_done();
ASSERT_SC(sc);
}
diff --git a/testsuites/libtests/block02/Makefile.am b/testsuites/libtests/block02/Makefile.am
index baa47914bc..e873b19c80 100644
--- a/testsuites/libtests/block02/Makefile.am
+++ b/testsuites/libtests/block02/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block02
block02_SOURCES = init.c
-dist_rtems_tests_DATA = block02.scn
+dist_rtems_tests_DATA = block02.scn block02.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block02/block02.doc b/testsuites/libtests/block02/block02.doc
new file mode 100644
index 0000000000..d700c8f508
--- /dev/null
+++ b/testsuites/libtests/block02/block02.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# Copyright (c) 2009
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# D-82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block02
+
+directives:
+
+ rtems_bdbuf_get
+
+concepts:
+
++ Check a special wake-up condition with two disks of different block sizes.
diff --git a/testsuites/libtests/block03/Makefile.am b/testsuites/libtests/block03/Makefile.am
index 9eb8aea776..4167201923 100644
--- a/testsuites/libtests/block03/Makefile.am
+++ b/testsuites/libtests/block03/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block03
block03_SOURCES = init.c
-dist_rtems_tests_DATA = block03.scn
+dist_rtems_tests_DATA = block03.scn block03.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block03/block03.doc b/testsuites/libtests/block03/block03.doc
new file mode 100644
index 0000000000..888fb93247
--- /dev/null
+++ b/testsuites/libtests/block03/block03.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# Copyright (c) 2009
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# D-82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block03
+
+directives:
+
+ rtems_bdbuf_get
+
+concepts:
+
++ Check a special wake-up condition with one disks and different blocks.
diff --git a/testsuites/libtests/block04/Makefile.am b/testsuites/libtests/block04/Makefile.am
index 4b77ae63e0..205070cd9b 100644
--- a/testsuites/libtests/block04/Makefile.am
+++ b/testsuites/libtests/block04/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block04
block04_SOURCES = init.c
-dist_rtems_tests_DATA = block04.scn
+dist_rtems_tests_DATA = block04.scn block04.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block04/block04.doc b/testsuites/libtests/block04/block04.doc
new file mode 100644
index 0000000000..7b90fdb504
--- /dev/null
+++ b/testsuites/libtests/block04/block04.doc
@@ -0,0 +1,31 @@
+#
+# $Id$
+#
+# Copyright (c) 2009
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# D-82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block04
+
+directives:
+
+concepts:
+
+directives:
+
+ rtems_bdbuf_get
+ rtems_bdbuf_sync
+
+concepts:
+
++ Check a special wake-up condition with one disk.
diff --git a/testsuites/libtests/block05/Makefile.am b/testsuites/libtests/block05/Makefile.am
index 0013eab2ac..f8429cc116 100644
--- a/testsuites/libtests/block05/Makefile.am
+++ b/testsuites/libtests/block05/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block05
block05_SOURCES = init.c
-dist_rtems_tests_DATA = block05.scn
+dist_rtems_tests_DATA = block05.scn block05.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block05/block05.doc b/testsuites/libtests/block05/block05.doc
new file mode 100644
index 0000000000..29ec114656
--- /dev/null
+++ b/testsuites/libtests/block05/block05.doc
@@ -0,0 +1,44 @@
+#
+# $Id$
+#
+# Copyright (c) 2009
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# D-82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block05
+
+directives:
+
+ rtems_bdbuf_get
+ rtems_bdbuf_read
+ rtems_bdbuf_release
+ rtems_bdbuf_release_modified
+ rtems_bdbuf_sync
+
+concepts:
+
++ State machine test.
+
+State changes count during this test:
+
+ | PREVIOUS STATE
+------+-------------------------------------------------------------------
+ | EM FR CA AC AM MO SY TR
+ | EM 6480 0 5040 0 0 0 0 0
+ | FR 5041 0 23040 0 0 0 0 0
+ | CA 0 0 0 22212 0 0 0 31608
+NEW | AC 0 17569 25739 0 0 0 0 0
+STATE | AM 0 0 0 0 0 3348 0 0
+ | MO 0 0 0 10548 2232 0 0 0
+ | SY 0 0 0 10548 1116 0 0 0
+ | TR 0 10512 0 0 0 9432 11664 0
diff --git a/testsuites/libtests/block05/init.c b/testsuites/libtests/block05/init.c
index ddfd112b96..4c3d1ac112 100644
--- a/testsuites/libtests/block05/init.c
+++ b/testsuites/libtests/block05/init.c
@@ -49,6 +49,7 @@
#define BLOCK_COUNT_B 1
+/* In case of trouble change this to 1 or 2 for more output */
static unsigned output_level = 0;
static dev_t dev_a;
@@ -73,27 +74,49 @@ static volatile enum resume_style {
} resume;
static volatile enum trig_style {
- SUSP,
- NO_SUSP
+ SUSP = 0,
+ CONT
} trig;
static volatile enum get_type {
- GET,
+ GET = 0,
READ
} trig_get, low_get, high_get;
static volatile enum blk_kind {
- BLK_A0,
+ BLK_A0 = 0,
BLK_A1,
BLK_B0
} trig_blk, low_blk, high_blk;
static volatile enum rel_type {
- REL,
+ REL = 0,
REL_MOD,
SYNC
} trig_rel, low_rel, high_rel;
+static const char trig_style_desc [] = {
+ 'S',
+ 'C'
+};
+
+static const char get_type_desc [] = {
+ 'G',
+ 'R'
+};
+
+static const char *blk_kind_desc [] = {
+ "A0",
+ "A1",
+ "B0"
+};
+
+static const char rel_type_desc [] = {
+ 'R',
+ 'M',
+ 'S'
+};
+
static void print(unsigned level, const char *fmt, ...)
{
if (level <= output_level) {
@@ -122,19 +145,23 @@ static rtems_bdbuf_buffer *get(enum get_type type, enum blk_kind kind)
rtems_status_code (*get_bd)(dev_t, rtems_blkdev_bnum, rtems_bdbuf_buffer **)
= NULL;
dev_t dev = 0;
+ size_t bds_per_group = 0;
switch (kind) {
case BLK_A0:
dev = dev_a;
blk_index = 0;
+ bds_per_group = 2;
break;
case BLK_A1:
dev = dev_a;
blk_index = 1;
+ bds_per_group = 2;
break;
case BLK_B0:
dev = dev_b;
blk_index = 0;
+ bds_per_group = 1;
break;
default:
assert(false);
@@ -154,7 +181,12 @@ static rtems_bdbuf_buffer *get(enum get_type type, enum blk_kind kind)
}
sc = (*get_bd)(dev, blk_index, &bd);
- assert(sc == RTEMS_SUCCESSFUL && bd->dev == dev && bd->block == blk_index);
+ assert(
+ sc == RTEMS_SUCCESSFUL
+ && bd->dev == dev
+ && bd->block == blk_index
+ && bd->group->bds_per_group == bds_per_group
+ );
return bd;
}
@@ -252,10 +284,18 @@ static void execute_test(unsigned i)
print(
1,
- "[%05u]T%i,TG%i,TB%i,TR%i,LG%i,LB%i,LR%i,HG%i,HB%i,HR%i\n",
- i, trig, trig_get, trig_blk, trig_rel,
- low_get, low_blk, low_rel,
- high_get, high_blk, high_rel
+ "[%05u]T(%c,%c,%s,%c)L(%c,%s,%c)H(%c,%s,%c)\n",
+ i,
+ trig_style_desc [trig],
+ get_type_desc [trig_get],
+ blk_kind_desc [trig_blk],
+ rel_type_desc [trig_rel],
+ get_type_desc [low_get],
+ blk_kind_desc [low_blk],
+ rel_type_desc [low_rel],
+ get_type_desc [high_get],
+ blk_kind_desc [high_blk],
+ rel_type_desc [high_rel]
);
set_task_prio(task_id_low, PRIORITY_LOW);
@@ -279,7 +319,7 @@ static void execute_test(unsigned i)
case SUSP:
suspend = true;
break;
- case NO_SUSP:
+ case CONT:
suspend = false;
break;
default:
@@ -432,7 +472,7 @@ static rtems_task Init(rtems_task_argument argument)
sc = rtems_task_suspend(task_id_high);
ASSERT_SC(sc);
- for (trig = SUSP; trig <= NO_SUSP; ++trig) {
+ for (trig = SUSP; trig <= CONT; ++trig) {
for (trig_get = GET; trig_get <= READ; ++trig_get) {
for (low_get = GET; low_get <= READ; ++low_get) {
for (high_get = GET; high_get <= READ; ++high_get) {
diff --git a/testsuites/libtests/block06/Makefile.am b/testsuites/libtests/block06/Makefile.am
index eee87ef1b4..a8146d4cc3 100644
--- a/testsuites/libtests/block06/Makefile.am
+++ b/testsuites/libtests/block06/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block06
block06_SOURCES = init.c
-dist_rtems_tests_DATA = block06.scn
+dist_rtems_tests_DATA = block06.scn block06.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block06/block06.doc b/testsuites/libtests/block06/block06.doc
new file mode 100644
index 0000000000..0096694485
--- /dev/null
+++ b/testsuites/libtests/block06/block06.doc
@@ -0,0 +1,21 @@
+#
+# $Id$
+#
+# Copyright 2008 Chris Johns (chrisj@rtems.org)
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block06
+
+directives:
+
+ TODO
+
+concepts:
+
+ TODO
diff --git a/testsuites/libtests/block07/Makefile.am b/testsuites/libtests/block07/Makefile.am
index 74907d1459..bf111af7ff 100644
--- a/testsuites/libtests/block07/Makefile.am
+++ b/testsuites/libtests/block07/Makefile.am
@@ -7,7 +7,7 @@ MANAGERS = io semaphore event
rtems_tests_PROGRAMS = block07
block07_SOURCES = init.c
-dist_rtems_tests_DATA = block07.scn
+dist_rtems_tests_DATA = block07.scn block07.doc
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
diff --git a/testsuites/libtests/block07/block07.doc b/testsuites/libtests/block07/block07.doc
new file mode 100644
index 0000000000..656d1c45b6
--- /dev/null
+++ b/testsuites/libtests/block07/block07.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# Copyright (c) 2009
+# embedded brains GmbH
+# Obere Lagerstr. 30
+# D-82178 Puchheim
+# Germany
+# <rtems@embedded-brains.de>
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: block07
+
+directives:
+
+ rtems_bdbuf_get
+
+concepts:
+
++ Test block size change condition.