Commit graph

73 commits

Author SHA1 Message Date
Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00
Lionel Sambuc e39e890e08 Importing sbin/chown
Change-Id: I49950ec241985a8a8f1fc29e01c0212278fbeaa9
2014-07-28 17:05:23 +02:00
Ben Gras aa6ee31737 test74: add mmap-related regression tests
tests many complex system/process memory interaction cases.

has to run as root so it can flush the FS cache; needed to
force FS cache misses for unmapped pages.

See the comment in test74.c for a full description of what the tested
cases are.

also re-enable filemap on arm
2014-07-28 17:05:14 +02:00
Ben Gras dda632a24f drop the minix_ prefixes for mmap and munmap
also cleanup of various minix-specific changes, cleanup of
mmap-related testing.

Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024
2014-03-03 20:47:03 +01:00
David van Moolenbroek 595d73a896 PM: rework signal handling
- introduce PROC_STOPPED flag, which tracks whether the process is
  stopped on PROC_STOP in the kernel, rather than implicitly deriving
  this from PM_SIG_PENDING;
- make the process resumption test based on current state rather than
  state transitions;
- add and clarify several flag checks in the signal handling code;
- add test79 to test signal handling robustness.

Change-Id: Ic8c7527095035b300b56f2ab1b9dd190bd4bf001
2014-03-01 09:04:59 +01:00
Ben Gras 6c8f7fc3ba netbsd dirent.h, import sys/sys *.h, mfs cleanup
. add all sys/sys headers not already present to help compiling
	. take netbsd dirent.h and struct dirent; main result is
	  introducing d_type and d_namlen that have to be set by getdents()
	  in all FS code implementing it
	. d_off is gone
	. alignment of the struct has become 8 bytes instead of 4
	. remove _MAX_BLOCK_SIZE, _MIN_BLOCK_SIZE, _STATIC_BLOCK_SIZE
	. libminlib: cleanup unused yet duplicate code
	. mfs: throw out the long-broken v1, v2 support
	. new test for dirent contents filled by getdents()

Change-Id: I1459755c7ba5e5d1c9396d3a587ce6e63ddc283e
2014-03-01 09:04:59 +01:00
David van Moolenbroek 214c4e152b Add testvnd.sh test script
As part of this, change the "run" script to allow certain scripts to
be run as root only.

Change-Id: I846e41037f9d4f6c7fc0b5ea8250303a7bd72f5d
2014-03-01 09:04:54 +01:00
David van Moolenbroek 1f8286c377 tests: do not skip installed shell tests
When installed, the test scripts lose their ".sh" suffix, causing them
to be skipped by the "run" script. With this patch, the tests are no
longer specified with ".sh" suffix in the run script, and the suffix
is added automatically as necessary.

LSC: Minor adaptation to keep track of history. As this patch has been
     forward ported into mainline, a simple rebase would loose this
     commit (cf commit 1f317d315c).

Change-Id: I0b72312e79992b9818559c6546a0e52cd95184c2
2014-03-01 09:04:53 +01:00
David van Moolenbroek 4211c5d267 tests: add test77 for opening/closing PTYs
Change-Id: I30e3418f75137aa08037fa6581ff3d4cce32a114
2014-02-18 11:25:03 +01:00
David van Moolenbroek d95a36f6ae tests: add test76 for interrupting VFS operations
Change-Id: Ic436cac61de8c42e0c7ee2d442c647528654cde9
2014-02-18 11:25:03 +01:00
Ben Gras 1f317d315c run: allow scripts to be run as root
Forward-port of the run script change in the testvnd
commit on the 3.3.0 branch by David.

Needed to cleanly run the testisofs test as root in
the Jenkins environment.

'While here,' also fix messy which output in testsh2.

Change-Id: I6ec472e1386a54ae74b6e55394f01fa7c5ce53a9
2013-11-28 13:31:37 +00:00
Ben Gras d3e3c78051 testmfs, testisofs: MFS format, ISO functionality
testmfs: catch MFS format changes

This test tests mkfs.mfs will generate the same FS image given the same
input files. mkproto creates a proto file (normalizing directory entry
order). The assumption is that a change in the output flags a tacit
change in FS format, and that a FS format change will cause the image
to change.

        . Changes to mkfs.mfs that innocently change the format can
          change the sha1 output in the script along with it.
        . The assumption is that corresponding versions of mkfs.mfs and
          MFS will always work together; otherwise a lot breaks (ramdisk etc.)
        . Therefore, as long as a generated FS image stays the same with the
          same input now, incompatible MFS changes will still be flagged,
          even if they work together with the current mkfs.mfs.

testisofs: test ISO filesystem

        . to test isofs: prepare an ISO FS image using writeisofs, copy it
          to a RAM device, mount it using the iso9660fs server, compare the
          SHA1 contents of the files on the ISO with the inputs.
        . use su to run certain commands in the script as root

run script: run shell script tests

	. they are installed without .sh so should be
	  searched for as such
	. add diagnostic when tests are skipped

Change-Id: I30daff58e1e43903dacf3c99996a4a0e7d819b6b
2013-11-21 10:17:43 +00:00
Ben Gras b5951f9663 vm: enable filemap=1 by default
. turns on mmap() functionality for files by default
	. also causes exec() to use it to map in executables
	  without copying and with sharing those pages with the
	  disk cache and other instances of the executable

Change-Id: Idb94dfe110eed916cf83b12c45e1a77241a2cee5
2013-09-13 12:56:41 +00:00
Xiaoguang Sun 64f10ee644 Implement getrusage
Implement getrusage.
These fields of struct rusage are not supported and always set to zero at this time
long ru_nswap;           /* swaps */
long ru_inblock;         /* block input operations */
long ru_oublock;         /* block output operations */
long ru_msgsnd;          /* messages sent */
long ru_msgrcv;          /* messages received */
long ru_nvcsw;           /* voluntary context switches */
long ru_nivcsw;          /* involuntary context switches */

test75.c is the unit test for this new function

Change-Id: I3f1eb69de1fce90d087d76773b09021fc6106539
2013-07-01 23:00:47 +02:00
Ben Gras fa86f72420 fix for tap tests
Change-Id: Ic79cfdaf420cbf15a1aba6e30c821f35b726d0da
2013-06-17 11:43:57 +00:00
Ben Gras 5120b43334 make test run script produce TAP if desired
. primarily intended for jenkins
	. see http://testanything.org/ for more info

Change-Id: If0e942f75898eed640f9edd89ef8ffd0bab9726e
2013-06-16 18:57:19 +00:00
Ben Gras 49b9165251 vm: mmap support
. test74 for mmap functionality
	. vm: add a mem_file memory type that specifies an mmap()ped
	  memory range, backed by a file
	. add fdref, an object that keeps track of FD references within
	  VM per process and so knows how to de-duplicate the use of FD's
	  by various mmap()ped ranges; there can be many more than there can
	  be FD's
	. turned off for now, enable with 'filemap=1' as boot option

Change-Id: I640b1126cdaa522a0560301cf6732b7661555672
2013-05-31 15:42:01 +00:00
Ben Gras adf2032bc0 vm: remove secondary cache code
This commit removes the secondary cache code implementation from
VM and its usage from libminixfs. It is to be replaced by a new
implementation.

Change-Id: I8fa3af06330e7604c7e0dd4cbe39d3ce353a05b1
2013-04-24 10:18:10 +00:00
Kees Jongenburger fcb66ed1b5 run script:return 1 upon test failure.
Change-Id: If3c9d636a04da7f7b4098b58d29c492c664dab1a
2013-04-21 20:18:11 +02:00
Ben Gras 32a4e0d84d many new tests
. test70: regression test for m_out vfs race condition

The following tests use testcache.c to generate test i/o
patterns, generate random write data and verify the reads.

	. test71: blackbox full-stack test of FS operation, testing
	  using the regular VFS interface crazy i/o patterns
	  with various working set sizes, triggering only
	  primary cache, also secondary cache, and finally
	  disk i/o and verifying contents all the time
	. test72: unit test of libminixfs, implementing
	  functions it needs from -lsys and -lblockdriver
	  and the client in order to simulate a working
	  cache client and backend environment.
	. test73: blackbox test of secondary vm cache in isolation

Change-Id: I1287e9753182b8719e634917ad158e3c1e079ceb
2013-04-19 16:21:48 +00:00
Ben Gras 0245723d5f run script: correction, clarity
Change-Id: Ibf583c6277c67646dd90d7c49482daf4e76b78b6
2013-04-19 10:24:50 +00:00
Ben Gras 2a44efb1c0 test run: feature for nicer jenkins interaction
. add -l option to list available tests
	. add -t option to specify tests to run
	. also improve the root check a bit by
	  not relying on an environment var
	. do not print the human-friendly banner & summary
	  if a test list is given to make the test
	  results easy to parse

Change-Id: Id0f87d485240b1924d667af788338ae31c3dc94c
2013-04-18 14:28:03 +00:00
Thomas Cort b3cb63379e tests/run: add test69 to setuids.
test69 requires superuser powers to adjust the time. This caused
the test to fail when run as a normal user. The patch adds test69
to the setuid list which will allow regular users to execute it.

Patch contributed by Antoine Leca.
2013-04-08 14:22:27 +02:00
Thomas Cort 18ad4c0799 test69: add clock_getres() and clock_gettime() tests. 2013-04-04 15:04:53 +02:00
Lionel Sambuc 5180c3cfb9 Installing posix tests in /usr/tests/minix-posix
The goal is to enable anyone to simply run our current test suite.

Change-Id: I27d8856cb82a4be2baa5dc5273526383b7f4fc2c
2013-03-13 10:43:16 +01:00
Thomas Veerman 2e723784ff test68: test pipe2 functionality
Change-Id: Idb15ec83983d0b052232c9533f89d637229d19df
2013-02-28 10:08:54 +00:00
Thomas Veerman 9c99b3b3b9 test67: test opening files and sockets with O_CLOEXEC
Change-Id: If71e61f830c6d3b5154368e189baa4f70bd73850
2013-02-28 10:08:54 +00:00
Thomas Veerman e104b46005 test set: use clear 2013-02-21 10:29:09 +00:00
Ben Gras 7a07b58aa8 test66: float smoke test, floating point fixes (arm)
Change-Id: Idd209ab6f341fbfb6b2dca77290ff440695bc2c1
2013-02-20 12:29:37 +00:00
Thomas Veerman d67db9b39c Add NTFS test to test suite 2012-11-26 15:20:18 +00:00
Ben Gras b1da7fafd0 vm: fix a null dereference on out-of-memory
. also make other out-of-memory conditions less fatal
	. add a test case for a user program using all the memory
	  it can
	. remove some diagnostic prints for situations that are normal
	  when running out of memory so running the test isn't noisy
2012-11-09 18:36:51 +01:00
David van Moolenbroek 1e78879f1e run test fix, take two 2012-04-20 11:34:56 +02:00
Ben Gras ed21b54203 run test fix 2012-04-18 15:59:37 +02:00
Ben Gras 5086f1b2a1 test scripts fixes 2012-04-16 16:04:44 +02:00
Ben Gras 0c8e5ecc2e tests: link them dynamically by default
. so that functionality is tested
	. add test63 that actually tests dlopen(), dlsym(),
	  etc. functionality; only built if clang supports it
	. also test10 test to copy more of the executable
2012-04-16 05:21:21 +02:00
David van Moolenbroek 0a8a2ecfb5 Kernel: pass FPU restore exception to user process
Previously, user processes could cause a kernel panic upon FPU state
restore, by passing bogus FPU state to the kernel (through e.g.
sigreturn). With this patch, the process is now sent a SIGFPE signal
instead.
2012-03-05 22:32:14 +01:00
Thomas Veerman 4c156d8a32 test set: remove GCC specificity 2012-02-17 17:22:37 +00:00
Ben Gras 34a8901eb8 vfs,avfs: verify an interpreter was found on #! line
. if not, NULL *interp is dereferenced
2011-12-21 23:44:13 +01:00
Thomas Veerman 706873142e Fix dangling symlink resolving for AVFS and add test61 2011-12-09 10:34:23 +00:00
Thomas Veerman b4fb061802 Implement issetugid syscall
Implement issetugid syscall and provide a test. This gets rid of the
scary "Unsecure. Implement me" warning during compilation.
2011-11-28 10:03:43 +00:00
Thomas Veerman 12e167f672 Add libmthread and test59 to test the implementation 2010-09-21 12:22:38 +00:00
Thomas Veerman 0b00cf70b6 - Return ENOENT when trying to add files to removed (but open) directories.
- Add test58 to test this behavior.
2010-09-01 09:07:18 +00:00
Erik van der Kouwe c8f70b8154 Fix tests when run as root; use bin account but current directory 2010-08-06 12:33:32 +00:00
Thomas Veerman e8846c3930 Also run test56, please 2010-08-04 10:03:50 +00:00
Ben Gras 83fc90c8c3 test57: test that state isn't corrupted after a signal handler being executed. 2010-08-04 09:00:58 +00:00
Ben Gras e3354a8556 test 55 for statvfs. fix formatting bug in test54. 2010-06-24 00:06:40 +00:00
Erik van der Kouwe 7570df267f Full 64-bit multitplication and division added to u64 library 2010-05-17 16:44:26 +00:00
Thomas Veerman 4ae9c03147 - Add test52 to test FPU context switching
- Make test/run count how many tests it's going to perform instead of having to
  manually update it ourselves.
2010-05-03 15:12:39 +00:00
Thomas Veerman bef0e3eb63 - Add support for the ucontext system calls (getcontext, setcontext,
swapcontext, and makecontext).
- Fix VM to not erroneously think the stack segment and data segment have
  collided when a user-space thread invokes brk().
- Add test51 to test ucontext functionality.
- Add man pages for ucontext system calls.
2010-03-12 15:58:41 +00:00
David van Moolenbroek bdd4f5857f Fixes for truncate system calls:
- VFS: check for negative sizes in all truncate calls
- VFS: update file size after truncating with fcntl(F_FREESP)
- VFS: move pos/len checks for F_FREESP with l_len!=0 from FS to VFS
- MFS: do not zero data block for small files when fully truncating
- MFS: do not write out freed indirect blocks after freeing space
- MFS: make truncate work correctly with differing zone/block sizes
- tests: add new test50 for truncate call family
2010-02-09 08:12:37 +00:00