change log for rtems (2010-08-02)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Aug 2 19:11:24 UTC 2010
*joel*:
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
* bspcmdline01/bspcmdline01.scn, bspcmdline01/init.c: Add test cases to
improve coverage.
M 1.230 testsuites/libtests/ChangeLog
M 1.4 testsuites/libtests/bspcmdline01/bspcmdline01.scn
M 1.8 testsuites/libtests/bspcmdline01/init.c
diff -u rtems/testsuites/libtests/ChangeLog:1.229 rtems/testsuites/libtests/ChangeLog:1.230
--- rtems/testsuites/libtests/ChangeLog:1.229 Fri Jul 30 22:07:34 2010
+++ rtems/testsuites/libtests/ChangeLog Mon Aug 2 13:11:53 2010
@@ -1,3 +1,8 @@
+2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * bspcmdline01/bspcmdline01.scn, bspcmdline01/init.c: Add test cases to
+ improve coverage.
+
2010-07-31 Ralf Corsépius <ralf.corsepius at rtems.org>
* tar01/Makefile.am, tar02/Makefile.am: Apply clean-local to remove
diff -u rtems/testsuites/libtests/bspcmdline01/bspcmdline01.scn:1.3 rtems/testsuites/libtests/bspcmdline01/bspcmdline01.scn:1.4
--- rtems/testsuites/libtests/bspcmdline01/bspcmdline01.scn:1.3 Mon Dec 28 10:42:08 2009
+++ rtems/testsuites/libtests/bspcmdline01/bspcmdline01.scn Mon Aug 2 13:11:53 2010
@@ -9,6 +9,8 @@
rtems_bsp_cmdline_get_param - bsp_boot_cmdline=NULL - returns NULL
rtems_bsp_cmdline_get_param_raw - bsp_boot_cmdline=NULL - returns NULL
rtems_bsp_cmdline_get_param - bsp_boot_cmdline = edit name = edit -no error
+rtems_bsp_cmdline_get_param - too short buffer
+rtems_bsp_cmdline_get_param_rhs - short match
Testing for param=(--arg)
Command Line : (--arg=)
diff -u rtems/testsuites/libtests/bspcmdline01/init.c:1.7 rtems/testsuites/libtests/bspcmdline01/init.c:1.8
--- rtems/testsuites/libtests/bspcmdline01/init.c:1.7 Sun Apr 25 14:12:22 2010
+++ rtems/testsuites/libtests/bspcmdline01/init.c Mon Aug 2 13:11:53 2010
@@ -49,9 +49,21 @@
rtems_test_assert( p == NULL );
bsp_boot_cmdline = "edit";
- puts ( "rtems_bsp_cmdline_get_param - bsp_boot_cmdline = edit name = edit -no error" );
+ puts (
+ "rtems_bsp_cmdline_get_param - bsp_boot_cmdline = edit name = "
+ "edit -no error" );
p = rtems_bsp_cmdline_get_param("edit", result, 5);
rtems_test_assert( p != NULL );
+
+ bsp_boot_cmdline = "joel=123456789";
+ puts( "rtems_bsp_cmdline_get_param - too short buffer" );
+ p = rtems_bsp_cmdline_get_param("joel", result, 5);
+ rtems_test_assert( p != NULL );
+
+ bsp_boot_cmdline = "--arg1=X`";
+ puts( "rtems_bsp_cmdline_get_param_rhs - short match" );
+ p = rtems_bsp_cmdline_get_param_rhs("arg", result, 10);
+ rtems_test_assert( p == NULL );
}
void test_search(
*joel*:
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
* Makefile.am, configure.ac: Add test for rtems_print_buffer().
* dumpbuf01/.cvsignore, dumpbuf01/Makefile.am, dumpbuf01/dumpbuf01.doc,
dumpbuf01/dumpbuf01.scn, dumpbuf01/init.c: New files.
M 1.231 testsuites/libtests/ChangeLog
M 1.46 testsuites/libtests/Makefile.am
M 1.54 testsuites/libtests/configure.ac
A 1.1 testsuites/libtests/dumpbuf01/.cvsignore
A 1.1 testsuites/libtests/dumpbuf01/Makefile.am
A 1.1 testsuites/libtests/dumpbuf01/dumpbuf01.doc
A 1.1 testsuites/libtests/dumpbuf01/dumpbuf01.scn
A 1.1 testsuites/libtests/dumpbuf01/init.c
diff -u rtems/testsuites/libtests/ChangeLog:1.230 rtems/testsuites/libtests/ChangeLog:1.231
--- rtems/testsuites/libtests/ChangeLog:1.230 Mon Aug 2 13:11:53 2010
+++ rtems/testsuites/libtests/ChangeLog Mon Aug 2 13:17:10 2010
@@ -1,5 +1,11 @@
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+ * Makefile.am, configure.ac: Add test for rtems_print_buffer().
+ * dumpbuf01/.cvsignore, dumpbuf01/Makefile.am, dumpbuf01/dumpbuf01.doc,
+ dumpbuf01/dumpbuf01.scn, dumpbuf01/init.c: New files.
+
+2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+
* bspcmdline01/bspcmdline01.scn, bspcmdline01/init.c: Add test cases to
improve coverage.
diff -u rtems/testsuites/libtests/Makefile.am:1.45 rtems/testsuites/libtests/Makefile.am:1.46
--- rtems/testsuites/libtests/Makefile.am:1.45 Tue Jul 27 13:16:49 2010
+++ rtems/testsuites/libtests/Makefile.am Mon Aug 2 13:17:10 2010
@@ -7,7 +7,7 @@
SUBDIRS = POSIX
SUBDIRS += bspcmdline01 cpuuse devfs01 devfs02 devfs03 devfs04 \
- devnullfatal01 gxx01 gxx02 \
+ devnullfatal01 dumpbuf01 gxx01 gxx02 \
malloctest malloc02 malloc03 malloc04 malloc05 heapwalk \
putenvtest monitor monitor02 rtmonuse stackchk stackchk01 \
termios termios01 termios02 termios03 termios04 termios05 \
diff -u rtems/testsuites/libtests/configure.ac:1.53 rtems/testsuites/libtests/configure.ac:1.54
--- rtems/testsuites/libtests/configure.ac:1.53 Fri Jul 30 03:42:37 2010
+++ rtems/testsuites/libtests/configure.ac Mon Aug 2 13:17:10 2010
@@ -54,6 +54,7 @@
devfs03/Makefile
devfs04/Makefile
devnullfatal01/Makefile
+dumpbuf01/Makefile
gxx01/Makefile
gxx02/Makefile
heapwalk/Makefile
diff -u /dev/null rtems/testsuites/libtests/dumpbuf01/.cvsignore:1.1
--- /dev/null Mon Aug 2 14:11:22 2010
+++ rtems/testsuites/libtests/dumpbuf01/.cvsignore Mon Aug 2 13:17:11 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/libtests/dumpbuf01/Makefile.am:1.1
--- /dev/null Mon Aug 2 14:11:22 2010
+++ rtems/testsuites/libtests/dumpbuf01/Makefile.am Mon Aug 2 13:17:11 2010
@@ -0,0 +1,26 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = dumpbuf01
+dumpbuf01_SOURCES = init.c
+
+dist_rtems_tests_DATA = dumpbuf01.scn
+dist_rtems_tests_DATA += dumpbuf01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(dumpbuf01_OBJECTS) $(dumpbuf01_LDADD)
+LINK_LIBS = $(dumpbuf01_LDLIBS)
+
+dumpbuf01$(EXEEXT): $(dumpbuf01_OBJECTS) $(dumpbuf01_DEPENDENCIES)
+ @rm -f dumpbuf01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/libtests/dumpbuf01/dumpbuf01.doc:1.1
--- /dev/null Mon Aug 2 14:11:22 2010
+++ rtems/testsuites/libtests/dumpbuf01/dumpbuf01.doc Mon Aug 2 13:17:11 2010
@@ -0,0 +1,22 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# 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: dumpbuf01
+
+directives:
+
+ rtems_print_buffer
+
+concepts:
+
++ Fully exercise rtems_print_buffer and provide full coverage of all paths.
diff -u /dev/null rtems/testsuites/libtests/dumpbuf01/dumpbuf01.scn:1.1
--- /dev/null Mon Aug 2 14:11:22 2010
+++ rtems/testsuites/libtests/dumpbuf01/dumpbuf01.scn Mon Aug 2 13:17:11 2010
@@ -0,0 +1,189 @@
+*** TEST DUMPBUF01 ***
+====== Printing 0 Bytes ======
+===============================
+
+====== Printing 1 Bytes ======
+41 |A |
+===============================
+
+====== Printing 2 Bytes ======
+41 42 |AB |
+===============================
+
+====== Printing 3 Bytes ======
+41 42 43 |ABC |
+===============================
+
+====== Printing 4 Bytes ======
+41 42 43 44 |ABCD |
+===============================
+
+====== Printing 5 Bytes ======
+41 42 43 44 45 |ABCDE |
+===============================
+
+====== Printing 6 Bytes ======
+41 42 43 44 45 46 |ABCDEF |
+===============================
+
+====== Printing 7 Bytes ======
+41 42 43 44 45 46 47 |ABCDEFG |
+===============================
+
+====== Printing 8 Bytes ======
+41 42 43 44 45 46 47 48 |ABCDEFGH |
+===============================
+
+====== Printing 9 Bytes ======
+41 42 43 44 45 46 47 48 49 |ABCDEFGHI |
+===============================
+
+====== Printing 10 Bytes ======
+41 42 43 44 45 46 47 48 49 4a |ABCDEFGHIJ |
+===============================
+
+====== Printing 11 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b |ABCDEFGHIJK |
+===============================
+
+====== Printing 12 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c |ABCDEFGHIJKL |
+===============================
+
+====== Printing 13 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d |ABCDEFGHIJKLM |
+===============================
+
+====== Printing 14 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e |ABCDEFGHIJKLMN |
+===============================
+
+====== Printing 15 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f |ABCDEFGHIJKLMNO |
+===============================
+
+====== Printing 16 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+===============================
+
+====== Printing 17 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 |Q |
+===============================
+
+====== Printing 18 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 |QR |
+===============================
+
+====== Printing 19 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 |QRS |
+===============================
+
+====== Printing 20 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 |QRST |
+===============================
+
+====== Printing 21 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 |QRSTU |
+===============================
+
+====== Printing 22 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 |QRSTUV |
+===============================
+
+====== Printing 23 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 |QRSTUVW |
+===============================
+
+====== Printing 24 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 |QRSTUVWX |
+===============================
+
+====== Printing 25 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 |QRSTUVWXY |
+===============================
+
+====== Printing 26 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a |QRSTUVWXYZ |
+===============================
+
+====== Printing 27 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 |QRSTUVWXYZ0 |
+===============================
+
+====== Printing 28 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 |QRSTUVWXYZ01 |
+===============================
+
+====== Printing 29 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 |QRSTUVWXYZ012 |
+===============================
+
+====== Printing 30 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 |QRSTUVWXYZ0123 |
+===============================
+
+====== Printing 31 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 |QRSTUVWXYZ01234 |
+===============================
+
+====== Printing 32 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+===============================
+
+====== Printing 33 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+36 |6 |
+===============================
+
+====== Printing 34 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+36 37 |67 |
+===============================
+
+====== Printing 35 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+36 37 38 |678 |
+===============================
+
+====== Printing 36 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+36 37 38 39 |6789 |
+===============================
+
+====== Printing 37 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+36 37 38 39 30 |67890 |
+===============================
+
+====== Printing 38 Bytes ======
+41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 |ABCDEFGHIJKLMNOP|
+51 52 53 54 55 56 57 58 59 5a 30 31 32 33 34 35 |QRSTUVWXYZ012345|
+36 37 38 39 30 0a |67890. |
+===============================
+
+====== Printing -1 Bytes ======
+ | |
+===============================
+
+*** END OF TEST DUMPBUF01 ***
diff -u /dev/null rtems/testsuites/libtests/dumpbuf01/init.c:1.1
--- /dev/null Mon Aug 2 14:11:22 2010
+++ rtems/testsuites/libtests/dumpbuf01/init.c Mon Aug 2 13:17:11 2010
@@ -0,0 +1,57 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * 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 <tmacros.h>
+#include "test_support.h"
+#include <rtems/dumpbuf.h>
+
+unsigned char Buffer[] =
+"ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890\n";
+
+void do_test(
+ int length
+)
+{
+ printf( "====== Printing %d Bytes ======\n", length );
+ rtems_print_buffer( Buffer, length );
+ printf( "===============================\n\n" );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+
+ puts( "\n\n*** TEST DUMPBUF01 ***" );
+
+ for ( i = 0 ; i < sizeof(Buffer) ; i++ ) {
+ do_test( i );
+ }
+ do_test( -1 );
+
+ puts( "*** END OF TEST DUMPBUF01 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
*joel*:
2010-07-30 Bharath Suri <bharath.s.jois at gmail.com>
PR 1642/testing
* psximfs02/init.c, psximfs02/psximfs02.scn,
psximfs02/psximfs02.doc: Added test cases to exercise chmod(),
chown() and routines in imfs_debug.c.
M 1.302 testsuites/psxtests/ChangeLog
M 1.2 testsuites/psxtests/psximfs02/init.c
M 1.2 testsuites/psxtests/psximfs02/psximfs02.doc
M 1.2 testsuites/psxtests/psximfs02/psximfs02.scn
diff -u rtems/testsuites/psxtests/ChangeLog:1.301 rtems/testsuites/psxtests/ChangeLog:1.302
--- rtems/testsuites/psxtests/ChangeLog:1.301 Thu Jul 29 17:40:49 2010
+++ rtems/testsuites/psxtests/ChangeLog Mon Aug 2 13:19:35 2010
@@ -1,3 +1,9 @@
+2010-07-30 Bharath Suri <bharath.s.jois at gmail.com>
+
+ PR 1642/testing
+ * psximfs02/init.c, psximfs02/psximfs02.scn,
+ psximfs02/psximfs02.doc: Added test cases to exercise chmod(),
+ chown() and routines in imfs_debug.c.
2010-07-29 Bharath Suri <bharath.s.jois at gmail.com>
PR 1642/testing
diff -u rtems/testsuites/psxtests/psximfs02/init.c:1.1 rtems/testsuites/psxtests/psximfs02/init.c:1.2
--- rtems/testsuites/psxtests/psximfs02/init.c:1.1 Thu Jul 29 17:40:50 2010
+++ rtems/testsuites/psxtests/psximfs02/init.c Mon Aug 2 13:19:35 2010
@@ -20,7 +20,7 @@
#include <rtems/libio.h>
extern Heap_Control *RTEMS_Malloc_Heap;
-
+void IMFS_dump( void );
rtems_task Init(
rtems_task_argument argument
)
@@ -129,11 +129,38 @@
rtems_test_assert( status == -1 );
rtems_test_assert( errno == ENOMEM );
+ puts( "Freeing allocated memory" );
+ free( alloc_ptr );
+
puts( "Attempt to stat a hardlink -- expect ENOTSUP" );
status = lstat( "/node-link", &stat_buf );
rtems_test_assert( status == -1 );
rtems_test_assert( errno == ENOTSUP );
+ puts( "Changing euid to 10" );
+ status = seteuid( 10 );
+ rtems_test_assert( status == 0 );
+
+ puts( "Attempt chmod on /node -- expect EPERM" );
+ status = chmod( "/node", S_IRUSR );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EPERM );
+
+ puts( "Attempt chown on /node -- expect EPERM" );
+ status = chown( "/node", 10, 10 );
+ rtems_test_assert( status == -1 );
+ rtems_test_assert( errno == EPERM );
+
+ puts( "Changing euid back to 0 [root]" );
+ status = seteuid( 0 );
+ rtems_test_assert( status == 0 );
+
+ puts( "Creating a fifo -- OK" );
+ status = mkfifo( "/fifo", S_IRWXU );
+ rtems_test_assert( status == 0 );
+
+ IMFS_dump();
+
puts( "*** END OF TEST IMFS 02 ***" );
rtems_test_exit(0);
}
@@ -149,5 +176,8 @@
#define CONFIGURE_INIT
+#define CONFIGURE_FIFOS_ENABLED
+#define CONFIGURE_MAXIMUM_FIFOS 1
+
#include <rtems/confdefs.h>
/* end of file */
diff -u rtems/testsuites/psxtests/psximfs02/psximfs02.doc:1.1 rtems/testsuites/psxtests/psximfs02/psximfs02.doc:1.2
--- rtems/testsuites/psxtests/psximfs02/psximfs02.doc:1.1 Thu Jul 29 17:40:50 2010
+++ rtems/testsuites/psxtests/psximfs02/psximfs02.doc Mon Aug 2 13:19:35 2010
@@ -22,6 +22,9 @@
+ symlink
+ mount
+ lstat
+ + IMFS_dump
+ + chmod
+ + chown
concepts:
diff -u rtems/testsuites/psxtests/psximfs02/psximfs02.scn:1.1 rtems/testsuites/psxtests/psximfs02/psximfs02.scn:1.2
--- rtems/testsuites/psxtests/psximfs02/psximfs02.scn:1.1 Thu Jul 29 17:40:50 2010
+++ rtems/testsuites/psxtests/psximfs02/psximfs02.scn Mon Aug 2 13:19:35 2010
@@ -33,5 +33,29 @@
Freeing allocated memory
Allocate most of heap
Attempt to create /node-slink-2 for /node -- expect ENOMEM
+Freeing allocated memory
Attempt to stat a hardlink -- expect ENOTSUP
+Changing euid to 10
+Attempt chmod on /node -- expect EPERM
+Attempt chown on /node -- expect EPERM
+Changing euid back to 0 [root]
+Creating a fifo -- OK
+*************** Dump of Entire IMFS ***************
+/
+....dev/
+........console (device 0, 0)
+....dir00/
+........dir01/
+........dir01-link0 links not printed
+........dir01-link1 links not printed
+........dir01-link2 links not printed
+........dir01-link3 links not printed
+........dir01-link4 links not printed
+........dir01-link5 links not printed
+........dir01-link6 links not printed
+....node (file 0)
+....node-link links not printed
+....node-slink links not printed
+....fifo FIFO not printed
+*************** End of Dump ***************
*** END OF TEST IMFS 02 ***
*joel*:
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
* libcsupport/src/base_fs.c, libcsupport/src/rtems_mkdir.c: Formatting.
M 1.2541 cpukit/ChangeLog
M 1.23 cpukit/libcsupport/src/base_fs.c
M 1.2 cpukit/libcsupport/src/rtems_mkdir.c
diff -u rtems/cpukit/ChangeLog:1.2540 rtems/cpukit/ChangeLog:1.2541
--- rtems/cpukit/ChangeLog:1.2540 Mon Aug 2 13:08:01 2010
+++ rtems/cpukit/ChangeLog Mon Aug 2 13:24:15 2010
@@ -1,3 +1,7 @@
+2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * libcsupport/src/base_fs.c, libcsupport/src/rtems_mkdir.c: Formatting.
+
2010-07-30 Bharath Suri <bharath.s.jois at gmail.com>
PR 1645/cpukit
diff -u rtems/cpukit/libcsupport/src/base_fs.c:1.22 rtems/cpukit/libcsupport/src/base_fs.c:1.23
--- rtems/cpukit/libcsupport/src/base_fs.c:1.22 Mon May 31 08:56:36 2010
+++ rtems/cpukit/libcsupport/src/base_fs.c Mon Aug 2 13:24:15 2010
@@ -48,14 +48,12 @@
/*
* mount the first filesystem.
*/
-
if ( rtems_filesystem_mount_table_size == 0 )
rtems_fatal_error_occurred( 0xABCD0001 );
mt = &rtems_filesystem_mount_table[0];
status = mount( mt->device, mt->mount_point, mt->type, mt->fsoptions, NULL );
-
if ( status == -1 )
rtems_fatal_error_occurred( 0xABCD0002 );
diff -u rtems/cpukit/libcsupport/src/rtems_mkdir.c:1.1 rtems/cpukit/libcsupport/src/rtems_mkdir.c:1.2
--- rtems/cpukit/libcsupport/src/rtems_mkdir.c:1.1 Tue Jun 8 08:05:11 2010
+++ rtems/cpukit/libcsupport/src/rtems_mkdir.c Mon Aug 2 13:24:15 2010
@@ -12,7 +12,7 @@
* Copyright (c) 2010 embedded brains GmbH.
*
* Copyright (c) 1983, 1992, 1993
- * The Regents of the University of California. All rights reserved.
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -60,82 +60,82 @@
static int
build(char *path, mode_t omode)
{
- struct stat sb;
- mode_t numask, oumask;
- int first, last, retval;
- char *p;
-
- p = path;
- oumask = 0;
- retval = 1;
- if (p[0] == '/') /* Skip leading '/'. */
- ++p;
- for (first = 1, last = 0; !last ; ++p) {
- if (p[0] == '\0')
- last = 1;
- else if (p[0] != '/')
- continue;
- *p = '\0';
- if (!last && p[1] == '\0')
- last = 1;
- if (first) {
- /*
- * POSIX 1003.2:
- * For each dir operand that does not name an existing
- * directory, effects equivalent to those caused by the
- * following command shall occcur:
- *
- * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
- * mkdir [-m mode] dir
- *
- * We change the user's umask and then restore it,
- * instead of doing chmod's.
- */
- oumask = umask(0);
- numask = oumask & ~(S_IWUSR | S_IXUSR);
- (void)umask(numask);
- first = 0;
- }
- if (last)
- (void)umask(oumask);
- if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
- if (errno == EEXIST || errno == EISDIR) {
- if (stat(path, &sb) < 0) {
- retval = 0;
- break;
- } else if (!S_ISDIR(sb.st_mode)) {
- if (last)
- errno = EEXIST;
- else
- errno = ENOTDIR;
- retval = 0;
- break;
- }
- if (last)
- retval = 2;
- } else {
- retval = 0;
- break;
- }
- }
- if (!last)
- *p = '/';
- }
- if (!first && !last)
- (void)umask(oumask);
- return (retval);
+ struct stat sb;
+ mode_t numask, oumask;
+ int first, last, retval;
+ char *p;
+
+ p = path;
+ oumask = 0;
+ retval = 1;
+ if (p[0] == '/') /* Skip leading '/'. */
+ ++p;
+ for (first = 1, last = 0; !last ; ++p) {
+ if (p[0] == '\0')
+ last = 1;
+ else if (p[0] != '/')
+ continue;
+ *p = '\0';
+ if (!last && p[1] == '\0')
+ last = 1;
+ if (first) {
+ /*
+ * POSIX 1003.2:
+ * For each dir operand that does not name an existing
+ * directory, effects equivalent to those caused by the
+ * following command shall occcur:
+ *
+ * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
+ * mkdir [-m mode] dir
+ *
+ * We change the user's umask and then restore it,
+ * instead of doing chmod's.
+ */
+ oumask = umask(0);
+ numask = oumask & ~(S_IWUSR | S_IXUSR);
+ (void)umask(numask);
+ first = 0;
+ }
+ if (last)
+ (void)umask(oumask);
+ if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
+ if (errno == EEXIST || errno == EISDIR) {
+ if (stat(path, &sb) < 0) {
+ retval = 0;
+ break;
+ } else if (!S_ISDIR(sb.st_mode)) {
+ if (last)
+ errno = EEXIST;
+ else
+ errno = ENOTDIR;
+ retval = 0;
+ break;
+ }
+ if (last)
+ retval = 2;
+ } else {
+ retval = 0;
+ break;
+ }
+ }
+ if (!last)
+ *p = '/';
+ }
+ if (!first && !last)
+ (void)umask(oumask);
+ return (retval);
}
int
rtems_mkdir(const char *path, mode_t mode)
{
- int success = 0;
- char *dup_path = strdup(path);
+ int success = 0;
+ char *dup_path = strdup(path);
- if (dup_path != NULL) {
- success = build(dup_path, mode);
- free(dup_path);
- }
+ if (dup_path != NULL) {
+ success = build(dup_path, mode);
+ free(dup_path);
+ }
- return success != 0 ? 0 : -1;
+ return success != 0 ? 0 : -1;
}
*joel*:
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
* libmisc/stackchk/check.c: If this port does not allocate the
interrupt stack, then it must always be a thread stack. Do not
include code to print the interrupt stack information.
M 1.2542 cpukit/ChangeLog
M 1.70 cpukit/libmisc/stackchk/check.c
diff -u rtems/cpukit/ChangeLog:1.2541 rtems/cpukit/ChangeLog:1.2542
--- rtems/cpukit/ChangeLog:1.2541 Mon Aug 2 13:24:15 2010
+++ rtems/cpukit/ChangeLog Mon Aug 2 13:26:30 2010
@@ -1,5 +1,11 @@
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+ * libmisc/stackchk/check.c: If this port does not allocate the
+ interrupt stack, then it must always be a thread stack. Do not
+ include code to print the interrupt stack information.
+
+2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+
* libcsupport/src/base_fs.c, libcsupport/src/rtems_mkdir.c: Formatting.
2010-07-30 Bharath Suri <bharath.s.jois at gmail.com>
diff -u rtems/cpukit/libmisc/stackchk/check.c:1.69 rtems/cpukit/libmisc/stackchk/check.c:1.70
--- rtems/cpukit/libmisc/stackchk/check.c:1.69 Sun Jul 4 09:53:47 2010
+++ rtems/cpukit/libmisc/stackchk/check.c Mon Aug 2 13:26:30 2010
@@ -420,16 +420,23 @@
else
used = 0;
- if ( the_thread ) {
- (*print_handler)(
- print_context,
- "0x%08" PRIx32 " %4s",
- the_thread->Object.id,
- rtems_object_get_name( the_thread->Object.id, sizeof(name), name )
- );
- } else {
- (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
- }
+
+ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
+ if ( the_thread )
+ #endif
+ {
+ (*print_handler)(
+ print_context,
+ "0x%08" PRIx32 " %4s",
+ the_thread->Object.id,
+ rtems_object_get_name( the_thread->Object.id, sizeof(name), name )
+ );
+ }
+ #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
+ else {
+ (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
+ }
+ #endif
(*print_handler)(
print_context,
*joel*:
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
* libfs/src/imfs/imfs_creat.c, libfs/src/imfs/imfs_eval.c,
libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_readlink.c,
libfs/src/pipe/fifo.c: Clean up for coverage improvements and
formatting.
M 1.2543 cpukit/ChangeLog
M 1.20 cpukit/libfs/src/imfs/imfs_creat.c
M 1.29 cpukit/libfs/src/imfs/imfs_eval.c
M 1.15 cpukit/libfs/src/imfs/imfs_mknod.c
M 1.8 cpukit/libfs/src/imfs/imfs_readlink.c
M 1.10 cpukit/libfs/src/pipe/fifo.c
diff -u rtems/cpukit/ChangeLog:1.2542 rtems/cpukit/ChangeLog:1.2543
--- rtems/cpukit/ChangeLog:1.2542 Mon Aug 2 13:26:30 2010
+++ rtems/cpukit/ChangeLog Mon Aug 2 13:27:22 2010
@@ -1,5 +1,12 @@
2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+ * libfs/src/imfs/imfs_creat.c, libfs/src/imfs/imfs_eval.c,
+ libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_readlink.c,
+ libfs/src/pipe/fifo.c: Clean up for coverage improvements and
+ formatting.
+
+2010-08-02 Joel Sherrill <joel.sherrill at oarcorp.com>
+
* libmisc/stackchk/check.c: If this port does not allocate the
interrupt stack, then it must always be a thread stack. Do not
include code to print the interrupt stack information.
diff -u rtems/cpukit/libfs/src/imfs/imfs_creat.c:1.19 rtems/cpukit/libfs/src/imfs/imfs_creat.c:1.20
--- rtems/cpukit/libfs/src/imfs/imfs_creat.c:1.19 Fri Jul 30 17:36:32 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_creat.c Mon Aug 2 13:27:22 2010
@@ -64,42 +64,28 @@
/*
* Set the type specific information
*/
- switch (type) {
- case IMFS_DIRECTORY:
- rtems_chain_initialize_empty(&node->info.directory.Entries);
- break;
-
- case IMFS_HARD_LINK:
- node->info.hard_link.link_node = info->hard_link.link_node;
- break;
-
- case IMFS_SYM_LINK:
- node->info.sym_link.name = info->sym_link.name;
- break;
-
- case IMFS_DEVICE:
- node->info.device.major = info->device.major;
- node->info.device.minor = info->device.minor;
- break;
-
- case IMFS_LINEAR_FILE:
- node->info.linearfile.size = 0;
- node->info.linearfile.direct = 0;
-
- case IMFS_MEMORY_FILE:
+ if ( type == IMFS_DIRECTORY ) {
+ rtems_chain_initialize_empty(&node->info.directory.Entries);
+ } else if ( type == IMFS_HARD_LINK ) {
+ node->info.hard_link.link_node = info->hard_link.link_node;
+ } else if ( type == IMFS_SYM_LINK ) {
+ node->info.sym_link.name = info->sym_link.name;
+ } else if ( type == IMFS_DEVICE ) {
+ node->info.device.major = info->device.major;
+ node->info.device.minor = info->device.minor;
+ } else if ( type == IMFS_LINEAR_FILE ) {
+ node->info.linearfile.size = 0;
+ node->info.linearfile.direct = 0;
+ if ( type == IMFS_MEMORY_FILE ) {
node->info.file.size = 0;
node->info.file.indirect = 0;
node->info.file.doubly_indirect = 0;
node->info.file.triply_indirect = 0;
- break;
-
- case IMFS_FIFO:
- node->info.fifo.pipe = NULL;
- break;
-
- default:
- IMFS_assert(0);
- break;
+ }
+ } else if ( type == IMFS_FIFO ) {
+ node->info.fifo.pipe = NULL;
+ } else {
+ IMFS_assert(0);
}
/*
diff -u rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.28 rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.29
--- rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.28 Thu Jun 24 16:31:22 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_eval.c Mon Aug 2 13:27:23 2010
@@ -70,7 +70,6 @@
* The following routine evaluates that we have permission
* to do flags on the node.
*/
-
int IMFS_evaluate_permission(
rtems_filesystem_location_info_t *node,
int flags
@@ -136,14 +135,11 @@
/*
* Check for things that should never happen.
*/
-
- if ( jnode->type != IMFS_HARD_LINK )
- rtems_fatal_error_occurred (0xABCD0000);
+ IMFS_assert( jnode->type == IMFS_HARD_LINK );
/*
* Set the hard link value and the handlers.
*/
-
node->node_access = jnode->info.hard_link.link_node;
IMFS_Set_handlers( node );
@@ -177,19 +173,13 @@
/*
* Check for things that should never happen.
*/
-
- if ( jnode->type != IMFS_SYM_LINK )
- rtems_fatal_error_occurred (0xABCD0000);
-
- if ( !jnode->Parent )
- rtems_fatal_error_occurred( 0xBAD00000 );
-
+ IMFS_assert( jnode->type == IMFS_SYM_LINK )
+ IMFS_assert( jnode->Parent )
/*
* Move the node_access to either the symbolic links parent or
* root depending on the symbolic links path.
*/
-
node->node_access = jnode->Parent;
rtems_filesystem_get_sym_start_loc(
@@ -201,7 +191,6 @@
/*
* Use eval path to evaluate the path of the symbolic link.
*/
-
result = IMFS_eval_path(
&jnode->info.sym_link.name[i],
strlen( &jnode->info.sym_link.name[i] ),
@@ -214,7 +203,6 @@
/*
* Verify we have the correct permissions for this node.
*/
-
if ( !IMFS_evaluate_permission( node, flags ) )
rtems_set_errno_and_return_minus_one( EACCES );
@@ -226,7 +214,6 @@
*
* The following routine returns the real node pointed to by a link.
*/
-
int IMFS_evaluate_link(
rtems_filesystem_location_info_t *node, /* IN/OUT */
int flags /* IN */
@@ -578,19 +565,23 @@
/*
* If we are at a link follow it.
*/
-
if ( node->type == IMFS_HARD_LINK ) {
-
IMFS_evaluate_hard_link( pathloc, 0 );
-
node = pathloc->node_access;
- if ( !node )
- rtems_set_errno_and_return_minus_one( ENOTDIR );
+
+ /*
+ * It would be a design error if we evaluated the link and
+ * was broken.
+ */
+ IMFS_assert( node );
} else if ( node->type == IMFS_SYM_LINK ) {
-
result = IMFS_evaluate_sym_link( pathloc, 0 );
+ /*
+ * In contrast to a hard link, it is possible to have a broken
+ * symbolic link.
+ */
node = pathloc->node_access;
if ( result == -1 )
return -1;
@@ -599,7 +590,6 @@
/*
* Only a directory can be decended into.
*/
-
if ( node->type != IMFS_DIRECTORY )
rtems_set_errno_and_return_minus_one( ENOTDIR );
@@ -607,7 +597,6 @@
* If we are at a node that is a mount point. Set loc to the
* new fs root node and let them finish evaluating the path.
*/
-
if ( node->info.directory.mt_fs != NULL ) {
newloc = node->info.directory.mt_fs->mt_fs_root;
*pathloc = newloc;
@@ -619,7 +608,6 @@
/*
* Otherwise find the token name in the present location.
*/
-
node = IMFS_find_match_in_dir( node, token );
if ( !node )
rtems_set_errno_and_return_minus_one( ENOENT );
diff -u rtems/cpukit/libfs/src/imfs/imfs_mknod.c:1.14 rtems/cpukit/libfs/src/imfs/imfs_mknod.c:1.15
--- rtems/cpukit/libfs/src/imfs/imfs_mknod.c:1.14 Tue Jan 19 13:31:00 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_mknod.c Mon Aug 2 13:27:23 2010
@@ -53,12 +53,10 @@
else if ( S_ISBLK(mode) || S_ISCHR(mode) ) {
type = IMFS_DEVICE;
rtems_filesystem_split_dev_t( dev, info.device.major, info.device.minor );
- }
- else if (S_ISFIFO(mode))
+ } else if (S_ISFIFO(mode))
type = IMFS_FIFO;
- else {
- rtems_set_errno_and_return_minus_one( EINVAL );
- }
+ else
+ IMFS_assert( 0 );
/*
* Allocate and fill in an IMFS jnode
@@ -70,14 +68,7 @@
* existed. The result was simpler code which should not have
* this path.
*/
- new_node = IMFS_create_node(
- pathloc,
- type,
- new_name,
- mode,
- &info
- );
-
+ new_node = IMFS_create_node( pathloc, type, new_name, mode, &info );
if ( !new_node )
rtems_set_errno_and_return_minus_one( ENOMEM );
diff -u rtems/cpukit/libfs/src/imfs/imfs_readlink.c:1.7 rtems/cpukit/libfs/src/imfs/imfs_readlink.c:1.8
--- rtems/cpukit/libfs/src/imfs/imfs_readlink.c:1.7 Sat Apr 17 03:34:41 2004
+++ rtems/cpukit/libfs/src/imfs/imfs_readlink.c Mon Aug 2 13:27:23 2010
@@ -34,8 +34,7 @@
node = loc->node_access;
- if ( node->type != IMFS_SYM_LINK )
- rtems_set_errno_and_return_minus_one( EINVAL );
+ IMFS_assert( node->type == IMFS_SYM_LINK );
for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
buf[i] = node->info.sym_link.name[i];
diff -u rtems/cpukit/libfs/src/pipe/fifo.c:1.9 rtems/cpukit/libfs/src/pipe/fifo.c:1.10
--- rtems/cpukit/libfs/src/pipe/fifo.c:1.9 Thu Jun 24 14:57:58 2010
+++ rtems/cpukit/libfs/src/pipe/fifo.c Mon Aug 2 13:27:23 2010
@@ -190,10 +190,11 @@
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_semaphore_release(pipe_semaphore);
- if (sc != RTEMS_SUCCESSFUL) {
- /* FIXME */
- rtems_fatal_error_occurred(0xdeadbeef);
- }
+ #ifdef RTEMS_DEBUG
+ if (sc != RTEMS_SUCCESSFUL) {
+ rtems_fatal_error_occurred(0xdeadbeef);
+ }
+ #endif
}
/*
@@ -248,15 +249,15 @@
pipe_control_t *pipe = *pipep;
uint32_t mode;
- if (pipe_lock())
+ #if defined(RTEMS_DEBUG)
/* WARN pipe not freed and pipep not set to NULL! */
- /* FIXME */
- rtems_fatal_error_occurred(0xdeadbeef);
+ if (pipe_lock())
+ rtems_fatal_error_occurred(0xdeadbeef);
- if (!PIPE_LOCK(pipe))
/* WARN pipe not released! */
- /* FIXME */
- rtems_fatal_error_occurred(0xdeadbeef);
+ if (!PIPE_LOCK(pipe))
+ rtems_fatal_error_occurred(0xdeadbeef);
+ #endif
mode = LIBIO_ACCMODE(iop);
if (mode & LIBIO_FLAGS_READ)
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100802/7ea09e81/attachment-0001.html>
More information about the vc
mailing list