You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(40) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(205) |
Feb
(281) |
Mar
(428) |
Apr
(444) |
May
(137) |
Jun
(341) |
Jul
(509) |
Aug
(184) |
Sep
(51) |
Oct
(70) |
Nov
(52) |
Dec
(41) |
| 2004 |
Jan
(27) |
Feb
|
Mar
|
Apr
(99) |
May
(562) |
Jun
(36) |
Jul
(74) |
Aug
(61) |
Sep
(33) |
Oct
(76) |
Nov
(64) |
Dec
(71) |
| 2005 |
Jan
(19) |
Feb
(28) |
Mar
(726) |
Apr
(310) |
May
(325) |
Jun
(496) |
Jul
(192) |
Aug
(72) |
Sep
(41) |
Oct
(294) |
Nov
(79) |
Dec
(64) |
| 2006 |
Jan
(112) |
Feb
(267) |
Mar
(33) |
Apr
(16) |
May
(121) |
Jun
(77) |
Jul
(43) |
Aug
(281) |
Sep
(97) |
Oct
(19) |
Nov
(15) |
Dec
(50) |
| 2007 |
Jan
(2) |
Feb
(31) |
Mar
(21) |
Apr
(76) |
May
(36) |
Jun
(97) |
Jul
(93) |
Aug
(85) |
Sep
(77) |
Oct
(35) |
Nov
(106) |
Dec
(81) |
| 2008 |
Jan
(86) |
Feb
(139) |
Mar
(378) |
Apr
(127) |
May
(196) |
Jun
(108) |
Jul
(136) |
Aug
(137) |
Sep
(114) |
Oct
(229) |
Nov
(312) |
Dec
(180) |
| 2009 |
Jan
(747) |
Feb
(907) |
Mar
(371) |
Apr
(174) |
May
(192) |
Jun
(163) |
Jul
(744) |
Aug
(495) |
Sep
(85) |
Oct
(950) |
Nov
(311) |
Dec
(180) |
| 2010 |
Jan
(303) |
Feb
(33) |
Mar
(9) |
Apr
|
May
(1) |
Jun
(4) |
Jul
(18) |
Aug
(37) |
Sep
(2) |
Oct
(2) |
Nov
(6) |
Dec
(3) |
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(17) |
Nov
(1) |
Dec
|
| 2013 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(2) |
| 2016 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ro...@us...> - 2003-01-01 20:50:40
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls In directory sc8-pr-cvs1:/tmp/cvs-serv6768/testcases/kernel/syscalls Modified Files: Makefile Log Message: Added ioperm() tests from Subhabrata Biswas. Index: Makefile =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/Makefile,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- Makefile 1 Jan 2003 20:44:12 -0000 1.41 +++ Makefile 1 Jan 2003 20:50:36 -0000 1.42 @@ -38,7 +38,7 @@ getgid getgroups gethostid gethostname getitimer getpeername \ getpgid getpgrp getpid getppid getpriority getresgid getresuid \ getrusage getsid getsockname getsockopt gettimeofday getuid \ - ioctl iopl ipc kill lchown link \ + ioctl ipc ioperm iopl kill lchown link \ listen llseek lseek lstat \ mkdir mknod mlock mlockall mmap modify_ldt mount mprotect \ mremap msync munlock munlockall munmap nanosleep nftw nice open \ |
|
From: <ro...@us...> - 2003-01-01 20:47:37
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/ioperm In directory sc8-pr-cvs1:/tmp/cvs-serv5909/ioperm Log Message: Directory /cvsroot/ltp/ltp/testcases/kernel/syscalls/ioperm added to the repository |
|
From: <ro...@us...> - 2003-01-01 20:44:16
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/capset
In directory sc8-pr-cvs1:/tmp/cvs-serv4930/testcases/kernel/syscalls/capset
Added Files:
Makefile capset01.c capset02.c
Log Message:
Added capset() tests from Saji Kumar.
--- NEW FILE: Makefile ---
#
# Copyright (c) International Business Machines Corp., 2001
#
# 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
###########################################################################
# name of file : Makefile #
###########################################################################
CFLAGS+= -I../../../../include -Wall -g
LOADLIBES+= -L../../../../lib -lltp
SRCS=$(wildcard *.c)
TARGETS=$(patsubst %.c,%,$(SRCS))
all: $(TARGETS)
install:
@for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
clean:
rm -f $(TARGETS)
--- NEW FILE: capset01.c ---
/*
* Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
*/
/**********************************************************
*
* TEST IDENTIFIER : capset01
*
* EXECUTED BY : anyone
*
* TEST TITLE : Basic test for capset(2)
*
* TEST CASE TOTAL : 1
*
* AUTHOR : Saji Kumar.V.R <saj...@wi...>
*
* SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
* DESCRIPTION
* This is a Phase I test for the capset(2) system call.
* It is intended to provide a limited exposure of the system call.
*
* Setup:
* Setup signal handling.
* Pause for SIGUSR1 if option specified.
* call capget() to save the current capability data
*
* Test:
* Loop if the proper options are given.
* call capset() with the saved data
* if return value == 0
* Test passed
* Otherwise
* Test failed
*
* Cleanup:
* Print errno log and/or timing stats if options given
*
* USAGE: <for command-line>
* capset01 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
* where, -c n : Run n copies concurrently.
* -e : Turn on errno logging.
* -h : Show help screen
* -f : Turn off functional testing
* -i n : Execute test n times.
* -I x : Execute test for x seconds.
* -p : Pause for SIGUSR1 before starting
* -P x : Pause for x seconds between iterations.
* -t : Turn on syscall timing.
****************************************************************/
#undef _POSIX_SOURCE
#include <errno.h>
#include <linux/capability.h>
#include "test.h"
#include "usctest.h"
static void setup();
static void cleanup();
char *TCID = "capset01"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
static struct __user_cap_header_struct header; /* cap_user_header_t is a pointer
to __user_cap_header_struct */
static struct __user_cap_data_struct data; /* cap_user_data_t is a pointer to
__user_cap_data_struct */
int
main(int ac, char **av)
{
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
/* parse standard options */
if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL))
!= (char *)NULL) {
tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
}
/* perform global setup for test */
setup();
/* check looping state if -i option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
Tst_count = 0;
TEST(capset(&header, &data));
if (TEST_RETURN == 0) {
tst_resm(TPASS, "capset() returned %d", TEST_RETURN);
} else {
tst_resm(TFAIL, "Test Failed, capset()"
" returned %d, errno = %d : %s", TEST_RETURN,
TEST_ERRNO, strerror(TEST_ERRNO));
}
} /* End for TEST_LOOPING */
/* cleanup and exit */
cleanup();
/*NOTREACHED*/
return 0;
} /* End main */
/* setup() - performs all ONE TIME setup for this test */
void
setup()
{
/* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
/* Pause if that option was specified */
TEST_PAUSE;
/*
* Save current capability data.
* header.version must be _LINUX_CAPABILITY_VERSION
*/
header.version = _LINUX_CAPABILITY_VERSION;
header.pid = 0;
if ((capget(&header, &data)) == -1) {
tst_brkm(TBROK, tst_exit, "capget() failed");
}
} /* End setup() */
/*
*cleanup() - performs all ONE TIME cleanup for this test at
* completion or premature exit.
*/
void
cleanup()
{
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
*/
TEST_CLEANUP;
/* exit with return code appropriate for results */
tst_exit();
/* End cleanup() */
}
--- NEW FILE: capset02.c ---
/*
* Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
*/
/**********************************************************
*
* TEST IDENTIFIER : capset02
*
* EXECUTED BY : anyone
*
* TEST TITLE : Tests for error conditions.
*
* TEST CASE TOTAL : 4
*
* AUTHOR : Saji Kumar.V.R <saj...@wi...>
*
* SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
* DESCRIPTION
* Verify that
* 1) capset() fails with errno set to EFAULT if an invalid address
* is given for header
* 2) capset() fails with errno set to EFAULT if an invalid address
* is given for data
* 3) capset() fails with errno set to EINVAL if an invalid value
* is given for header->version
* 4) capset() fails with errno set to EPERM the process does not
* have enough privilege to set capabilities
*
*
* Setup:
* Setup signal handling.
* Pause for SIGUSR1 if option specified.
* Call capget() to save current capability data
*
* Test:
* Loop if the proper options are given.
* do test specific setup.
* call capset with proper arguments
* if capset() fails with expected errno
* Test passed
* Otherwise
* Test failed
* do test specific cleanup
*
* Cleanup:
* Print errno log and/or timing stats if options given
*
* USAGE: <for command-line>
* capset02 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
* where, -c n : Run n copies concurrently.
* -e : Turn on errno logging.
* -h : Show help screen
* -f : Turn off functional testing
* -i n : Execute test n times.
* -I x : Execute test for x seconds.
* -p : Pause for SIGUSR1 before starting
* -P x : Pause for x seconds between iterations.
* -t : Turn on syscall timing.
*
****************************************************************/
#undef _POSIX_SOURCE
#include <errno.h>
#include <pwd.h>
#include <linux/capability.h>
#include "test.h"
#include "usctest.h"
#define INVALID_VERSION 0
static void setup();
static void cleanup();
static void test_setup(int);
char *TCID = "capset02"; /* Test program identifier. */
extern int Tst_count; /* Test Case counter for tst_* routines */
static int exp_enos[] = { EFAULT, EINVAL, EPERM, 0 };
static struct __user_cap_header_struct header;
static struct __user_cap_data_struct data;
struct test_case_t {
cap_user_header_t headerp;
cap_user_data_t datap;
int exp_errno;
char *errdesc;
} test_cases[] = {
{ (cap_user_header_t)-1, &data, EFAULT, "EFAULT" },
{ &header, (cap_user_data_t)-1, EFAULT, "EFAULT" },
{ &header, &data, EINVAL, "EINVAL" },
{ &header, &data, EPERM, "EPERM" },
};
int TST_TOTAL = sizeof(test_cases) / sizeof(test_cases[0]);
int
main(int ac, char **av)
{
int lc, i; /* loop counter */
char *msg; /* message returned from parse_opts */
/* parse standard options */
if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL))
!= (char *)NULL) {
tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
}
/* perform global setup for test */
setup();
/* check looping state if -i option given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping. */
Tst_count = 0;
for (i = 0; i < TST_TOTAL; ++i) {
test_setup(i);
TEST(capset(test_cases[i].headerp,
test_cases[i].datap));
if ((TEST_RETURN == -1) && (TEST_ERRNO ==
test_cases[i].exp_errno)) {
tst_resm(TPASS, "capset() returned -1,"
" errno: %s", test_cases[i].errdesc);
} else {
tst_resm(TFAIL, "Test Failed, capset()"
" returned %d, errno = %d : %s", TEST_RETURN,
TEST_ERRNO, strerror(TEST_ERRNO));
}
TEST_ERROR_LOG(TEST_ERRNO);
}
} /* End for TEST_LOOPING */
/* cleanup and exit */
cleanup();
/*NOTREACHED*/
return 0;
} /* End main */
/* setup() - performs all ONE TIME setup for this test */
void
setup()
{
/* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
/* Set up the expected error numbers for -e option */
TEST_EXP_ENOS(exp_enos);
/* Pause if that option was specified */
TEST_PAUSE;
/*
* Save current capability data.
* header.version must be _LINUX_CAPABILITY_VERSION
*/
header.version = _LINUX_CAPABILITY_VERSION;
if ((capget(&header, &data)) == -1) {
tst_brkm(TBROK, tst_exit, "capget() failed");
}
} /* End setup() */
/*
*cleanup() - performs all ONE TIME cleanup for this test at
* completion or premature exit.
*/
void
cleanup()
{
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
*/
TEST_CLEANUP;
/* exit with return code appropriate for results */
tst_exit();
} /* End cleanup() */
void
test_setup(int i)
{
switch (i) {
case 0 :
break;
case 1 :
header.version = _LINUX_CAPABILITY_VERSION;
header.pid = 0;
break;
case 2 :
header.version = INVALID_VERSION;
header.pid = 0;
break;
case 3 :
header.version = _LINUX_CAPABILITY_VERSION;
/*
* when a non-zero pid is specified, process should have
* CAP_SETPCAP capability to change capabilities.
* by default, CAP_SETPCAP is not enabled. So giving
* a non-zero pid results in capset() failing with
* errno EPERM
*/
header.pid = getpid();
break;
}
}
|
|
From: <ro...@us...> - 2003-01-01 20:44:16
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls In directory sc8-pr-cvs1:/tmp/cvs-serv4930/testcases/kernel/syscalls Modified Files: Makefile Log Message: Added capset() tests from Saji Kumar. Index: Makefile =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/Makefile,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Makefile 31 Dec 2002 22:53:24 -0000 1.40 +++ Makefile 1 Jan 2003 20:44:12 -0000 1.41 @@ -30,7 +30,7 @@ SUBDIR= \ abort accept access acct adjtimex alarm asyncio bind brk capget\ - chdir chmod chown chroot clone close connect confstr \ + capset chdir chmod chown chroot clone close connect confstr \ creat create_module delete_module dup dup2 execl \ execle execlp execv execve execvp exit fchdir fchmod \ fchown fcntl fdatasync flock fmtmsg fork fpathconf fstat fstatfs \ |
|
From: <ro...@us...> - 2003-01-01 20:44:15
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv4930/runtest Modified Files: syscalls Log Message: Added capset() tests from Saji Kumar. Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- syscalls 1 Jan 2003 20:38:17 -0000 1.95 +++ syscalls 1 Jan 2003 20:44:12 -0000 1.96 @@ -31,6 +31,9 @@ capget01 capget01 capget02 capget02 +capset01 capset01 +capset02 capset02 + chdir01 chdir01 chdir01A symlink01 -T chdir01 chdir02 chdir02 |
|
From: <ro...@us...> - 2003-01-01 20:40:45
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/capset In directory sc8-pr-cvs1:/tmp/cvs-serv3272/capset Log Message: Directory /cvsroot/ltp/ltp/testcases/kernel/syscalls/capset added to the repository |
|
From: <ro...@us...> - 2003-01-01 20:38:21
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/syslog
In directory sc8-pr-cvs1:/tmp/cvs-serv2172/testcases/kernel/syscalls/syslog
Modified Files:
Makefile
Added Files:
syslog11.c syslog12.c
Log Message:
Added syslog11 & syslog12 tests from T.L. Madhu.
--- NEW FILE: syslog11.c ---
/*
* Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
*/
/**********************************************************
*
* TEST IDENTIFIER : syslog11
*
* EXECUTED BY : root / superuser
*
* TEST TITLE : Basic tests for syslog(2)
*
* TEST CASE TOTAL : 11
*
* AUTHOR : Madhu T L <mad...@wi...>
*
* SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
* DESCRIPTION
* Verify that, syslog(2) is successful for type ranging from 1 to 8
*
* Setup:
* Setup signal handling.
* Test caller is superuser
* Check existence of user nobody
* Pause for SIGUSR1 if option specified.
*
* Test:
* Loop if the proper options are given.
* Execute system call
* Check return value, if not successful,
* Issue FAIL message
* Otherwise,
* Issue PASS message
*
* Cleanup:
* Print errno log and/or timing stats if options given
*
* USAGE: <for command-line>
* syslog11 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
* where, -c n : Run n copies concurrently.
* -e : Turn on errno logging.
* -f : Turn off functional testing
* -h : Show help screen
* -i n : Execute test n times.
* -I x : Execute test for x seconds.
* -p : Pause for SIGUSR1 before starting
* -P x : Pause for x seconds between iterations.
* -t : Turn on syscall timing.
*
****************************************************************/
#include <errno.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/unistd.h>
#include "test.h"
#include "usctest.h"
#define UNEXP_RET_VAL -1
extern int Tst_count;
struct test_case_t { /* test case structure */
int type; /* 1st arg. */
char *buf; /* 2nd arg. */
int len; /* 3rd arg. */
int (*setup) (void); /* Individual setup routine */
void (*cleanup) (void); /* Individual cleanup routine */
char *desc; /* Test description */
};
char *TCID = "syslog11";
static int testno;
static char buf;
static struct passwd *ltpuser;
static void setup(void);
static void cleanup(void);
static int setup1(void);
static void cleanup1(void);
_syscall3(int, syslog, int, type, char *, bufp, int, len);
static struct test_case_t tdat[] = {
/* Type 0 and 1 are currently not implemented, always returns success */
{ 0, &buf, 0, NULL, NULL, "type 0/Close the log" },
{ 1, &buf, 0, NULL, NULL, "type 1/Open the log" },
{ 2, &buf, 0, NULL, NULL, "type 2/Read from the log" },
{ 3, &buf, 0, NULL, NULL, "type 3/Read ring buffer" },
{ 3, &buf, 0, setup1, cleanup1, "type 3/Read ring buffer for non-root "
"user" },
{ 4, &buf, 0, NULL, NULL, "type 4/Read and clear ring buffer" },
{ 5, &buf, 0, NULL, NULL, "type 5/Clear ring buffer" },
{ 8, NULL, 1, NULL, NULL, "type 8/Set log level to 1" },
{ 8, NULL, 7, NULL, NULL, "type 8/Set log level to 7(default)" },
{ 6, NULL, 0, NULL, NULL, "type 6/Disable printk's to console" },
{ 7, NULL, 0, NULL, NULL, "type 7/Enable printk's to console" },
};
int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
int
main(int argc, char **argv)
{
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
/* parse standard options */
if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) !=
(char *)NULL) {
tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
}
setup();
/* check looping state if -i option is given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping */
Tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
if( tdat[testno].setup && tdat[testno].setup() ) {
/* Setup failed, skip this testcase */
continue;
}
TEST(syslog(tdat[testno].type, tdat[testno].buf,
tdat[testno].len));
if (TEST_RETURN == UNEXP_RET_VAL) {
tst_resm(TFAIL, "syslog() failed for %s: errno "
"%d", tdat[testno].desc, TEST_ERRNO);
} else {
tst_resm(TPASS, "syslog() successful for %s",
tdat[testno].desc);
}
if(tdat[testno].cleanup) {
tdat[testno].cleanup();
}
}
}
cleanup();
/*NOTREACHED*/
return 0;
}
int
setup1(void)
{
/* Change effective user id to nodody */
if (seteuid(ltpuser->pw_uid) == -1) {
tst_resm(TBROK, "seteuid failed to set the effective"
" uid to %d", ltpuser->pw_uid);
return 1;
}
return 0;
}
void
cleanup1(void)
{
/* Change effective user id to root */
if (seteuid(0) == -1) {
tst_brkm(TBROK, tst_exit, "seteuid failed to set the effective"
" uid to root");
}
}
/*
* setup()
* performs all ONE TIME setup for this test
*/
void
setup(void)
{
/* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
/* Check whether we are root */
if (geteuid() != 0) {
tst_brkm(TBROK, tst_exit, "Must be root for this test!");
/*NOTREACHED*/
}
/* Check for nobody_uid user id */
if ( (ltpuser = getpwnam("nobody")) == NULL) {
tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
/* NOTREACHED */
}
/* Pause if that option was specified
* TEST_PAUSE contains the code to fork the test with the -c option.
*/
TEST_PAUSE;
}
/*
* cleanup()
* performs all ONE TIME cleanup for this test at
* completion or premature exit
*/
void
cleanup(void)
{
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
*/
TEST_CLEANUP;
/* exit with return code appropriate for results */
tst_exit();
/*NOTREACHED*/
}
--- NEW FILE: syslog12.c ---
/*
* Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
*/
/**********************************************************
*
* TEST IDENTIFIER : syslog12
*
* EXECUTED BY : root / superuser
*
* TEST TITLE : Checking error conditions for syslog(2)
*
* TEST CASE TOTAL : 7
*
* AUTHOR : Madhu T L <mad...@wi...>
*
* SIGNALS
* Uses SIGUSR1 to pause before test if option set.
* (See the parse_opts(3) man page).
*
* DESCRIPTION
* Verify that,
* 1. syslog(2) fails with EINVAL for invalid type/command
* 2. syslog(2) fails with EFAULT for buffer outside program's accessible
* address space.
* 3. syslog(2) fails with EINVAL for NULL buffer argument.
* 4. syslog(2) fails with EINVAL for length arg. set to negative value.
* 5. syslog(2) fails with EPERM for non-root user.
* 6. syslog(2) fails with EINVAL for console level less than 0.
* 7. syslog(2) fails with EINVAL for console level greater than 8.
*
* Setup:
* Setup signal handling.
* Test caller is superuser
* Check existence of user nobody
* Set expected errnos
* Pause for SIGUSR1 if option specified.
*
* Test:
* Loop if the proper options are given.
* Execute system call
* Check return value and errno, if matching,
* Issue PASS message
* Otherwise,
* Issue FAIL message
*
* Cleanup:
* Print errno log and/or timing stats if options given
*
* USAGE: <for command-line>
* syslog12 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
* where, -c n : Run n copies concurrently.
* -e : Turn on errno logging.
* -f : Turn off functional testing
* -h : Show help screen
* -i n : Execute test n times.
* -I x : Execute test for x seconds.
* -p : Pause for SIGUSR1 before starting
* -P x : Pause for x seconds between iterations.
* -t : Turn on syscall timing.
*
****************************************************************/
#include <errno.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/unistd.h>
#include "test.h"
#include "usctest.h"
#define EXP_RET_VAL -1
extern int Tst_count;
struct test_case_t { /* test case structure */
int type; /* 1st arg */
char *buf; /* 2nd arg */
int len; /* 3rd arg */
int exp_errno; /* Expected errno */
int (*setup) (void); /* Individual setup routine */
void (*cleanup) (void); /* Individual cleanup routine */
char *desc; /* Test description */
};
char *TCID = "syslog12";
static int testno;
static int exp_enos[] = {EPERM, EINVAL, EFAULT, 0};
static char buf;
static struct passwd *ltpuser;
static void setup(void);
static void cleanup(void);
static int setup1(void);
static void cleanup1(void);
_syscall3(int, syslog, int, type, char *, bufp, int, len);
static struct test_case_t tdat[] = {
{ 100, &buf, 0, EINVAL, NULL, NULL, "invalid type/command" },
{ 2, (char *) -1, 1, EFAULT, NULL, NULL, "buffer outside program's "
"accessible address space" },
{ 2, (char *) NULL, 0, EINVAL, NULL, NULL, "NULL buffer argument" },
{ 3, &buf, -1, EINVAL, NULL, NULL, "negative length argument" },
{ 2, &buf, 0, EPERM, setup1, cleanup1, "non-root user" },
{ 8, &buf, -1, EINVAL, NULL, NULL, "console level less than 0" },
{ 8, &buf, 9, EINVAL, NULL, NULL, "console level greater than 8" },
};
int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
int
main(int argc, char **argv)
{
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
/* parse standard options */
if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) !=
(char *)NULL) {
tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
}
setup();
/* check looping state if -i option is given */
for (lc = 0; TEST_LOOPING(lc); lc++) {
/* reset Tst_count in case we are looping */
Tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
if( tdat[testno].setup && tdat[testno].setup() ) {
/* Setup failed, skip this testcase */
continue;
}
TEST(syslog(tdat[testno].type, tdat[testno].buf,
tdat[testno].len));
TEST_ERROR_LOG(TEST_ERRNO);
if ( (TEST_RETURN == EXP_RET_VAL) &&
(TEST_ERRNO == tdat[testno].exp_errno) ) {
tst_resm(TPASS, "syslog() failed as expected"
" for %s : errno %d", tdat[testno].desc,
TEST_ERRNO);
} else {
tst_resm(TFAIL, "syslog() returned "
"unexpected results for %s ; returned"
" %d (expected %d), errno %d (expected"
" %d)", tdat[testno].desc,
TEST_RETURN, EXP_RET_VAL, TEST_ERRNO,
tdat[testno].exp_errno);
}
if(tdat[testno].cleanup) {
tdat[testno].cleanup();
}
}
}
cleanup();
/*NOTREACHED*/
return 0;
}
int
setup1(void)
{
/* Change effective user id to nodody */
if (seteuid(ltpuser->pw_uid) == -1) {
tst_resm(TBROK, "seteuid failed to set the effective"
" uid to %d", ltpuser->pw_uid);
return 1;
}
return 0;
}
void
cleanup1(void)
{
/* Change effective user id to root */
if (seteuid(0) == -1) {
tst_brkm(TBROK, tst_exit, "seteuid failed to set the effective"
" uid to root");
}
}
/*
* setup()
* performs all ONE TIME setup for this test
*/
void
setup(void)
{
/* capture signals */
tst_sig(NOFORK, DEF_HANDLER, cleanup);
/* Check whether we are root */
if (geteuid() != 0) {
tst_brkm(TBROK, tst_exit, "Must be root for this test!");
/*NOTREACHED*/
}
/* Check for nobody_uid user id */
if ( (ltpuser = getpwnam("nobody")) == NULL) {
tst_brkm(TBROK, tst_exit, "nobody user id doesn't exist");
/* NOTREACHED */
}
/* set the expected errnos... */
TEST_EXP_ENOS(exp_enos);
/* Pause if that option was specified
* TEST_PAUSE contains the code to fork the test with the -c option.
*/
TEST_PAUSE;
}
/*
* cleanup()
* performs all ONE TIME cleanup for this test at
* completion or premature exit
*/
void
cleanup(void)
{
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
*/
TEST_CLEANUP;
/* exit with return code appropriate for results */
tst_exit();
/*NOTREACHED*/
}
Index: Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/syslog/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile 11 Dec 2002 21:48:14 -0000 1.2
+++ Makefile 1 Jan 2003 20:38:18 -0000 1.3
@@ -25,11 +25,12 @@
SRCS=$(wildcard *.c)
TARGETS=$(patsubst %.c,%,$(SRCS))
+SCRIPTS= syslog01 syslog02 syslog03 syslog04 syslog05 syslog06 syslog07 syslog08 syslog09 syslog10
-all: $(TARGETS) syslog01 syslog02 syslog03 syslog04 syslog05 syslog06 syslog07 syslog08 syslog09 syslog10
+all: $(TARGETS)
install:
- @for i in $(TARGETS) syslog01 syslog02 syslog03 syslog04 syslog05 syslog06 syslog07 syslog08 syslog09 syslog10 ; do ln -f $$i ../../../bin/$$i ; done
+ @for i in $(TARGETS) $(SCRIPTS) ; do ln -f $$i ../../../bin/$$i ; done
clean:
rm -f $(TARGETS)
|
|
From: <ro...@us...> - 2003-01-01 20:38:21
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv2172/runtest Modified Files: syscalls Log Message: Added syslog11 & syslog12 tests from T.L. Madhu. Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- syscalls 31 Dec 2002 22:53:23 -0000 1.94 +++ syscalls 1 Jan 2003 20:38:17 -0000 1.95 @@ -776,6 +776,8 @@ syslog08 syslog08 syslog09 syslog09 syslog10 syslog10 +syslog11 syslog11 +syslog12 syslog12 time01 time01 time02 time02 |
|
From: <ro...@us...> - 2002-12-31 22:53:28
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/syscall
In directory sc8-pr-cvs1:/tmp/cvs-serv18276/testcases/kernel/syscalls/syscall
Added Files:
Makefile syscall01.c
Log Message:
Added syscall() test ported by Ananda Venkataraman <av...@us...>
--- NEW FILE: Makefile ---
#
# Copyright (c) International Business Machines Corp., 2001
#
# 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
###########################################################################
# name of file : Makefile #
###########################################################################
CFLAGS+= -I../../../../include -O -g -Wall
LOADLIBES+= -L../../../../lib -lltp
SRCS=$(wildcard *.c)
TARGETS=$(patsubst %.c,%,$(SRCS))
all: $(TARGETS)
install:
@for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
clean:
rm -f $(TARGETS)
--- NEW FILE: syscall01.c ---
/*
*
* Copyright (c) International Business Machines Corp., 2002
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* 01/02/2003 Port to LTP av...@us...*/
/* 06/30/2001 Port to Linux nsh...@us... */
/*
* NAME
* syscall1.c -- test syscall
*
* CALLS
* syscall
*
* ALGORITHM
* Use syscall to simulate some section 2 calls and make sure
* things work as expected. Pretty simple, but if it works
* for a few it should work for all.
*
* RESTRICTIONS
* The syscall numbers are system dependent!! They represent
* entries in a table and can be changed from kernel to kernel.
* They ARE differnet between vax 4.2BSD and our ported system.
*/
#include <stdio.h> /* needed by testhead.h */
#include <syscall.h>
#include <errno.h>
/***** LTP Port *****/
#include "test.h"
#include "usctest.h"
#define FAILED 0
#define PASSED 1
char *TCID = "syscall01";
int local_flag = PASSED;
int block_number;
int errno;
FILE *temp;
int TST_TOTAL = 1;
extern int Tst_count;
/***** ** ** *****/
//char progname[]= "syscall1()";
#define ITER 500
int t_flag;
int errno;
/***** LTP Port *****/
void setup();
int blenter();
int blexit();
int anyfail();
void cleanup();
void do_setpg();
void fail_exit();
/***** ** ** *****/
/*--------------------------------------------------------------*/
int main (int argc, char *argv[])
{
register int i;
int v1, v2;
setup(); /* temp file is now open */
/*--------------------------------------------------------------*/
blenter();
for (i=0; i < ITER; i++) {
v1 = getpid();
v2 = syscall(SYS_getpid);
if (v1 != v2) {
fprintf(temp, "\tgetpid syscall failed.\n");
fprintf(temp, "\t iteration %d\n", i);
local_flag = FAILED;
break;
}
}
blexit();
/*--------------------------------------------------------------*/
blenter();
for (i=0; i < ITER; i++) {
v1 = getuid();
v2 = syscall(SYS_getuid);
if (v1 != v2) {
fprintf(temp, "\tgetuid syscall failed.\n");
fprintf(temp, "\t iteration %d\n", i);
local_flag = FAILED;
break;
}
}
blexit();
/*--------------------------------------------------------------*/
blenter();
for (i=0; i < ITER; i++) {
v1 = getgid();
v2 = syscall(SYS_getgid);
if (v1 != v2) {
fprintf(temp, "\tgetgid syscall failed.\n");
fprintf(temp, "\t iteration %d\n", i);
local_flag = FAILED;
break;
}
}
blexit();
/*--------------------------------------------------------------*/
/***************************************************************
* cleanup and exit
***************************************************************/
cleanup();
anyfail(); /* THIS CALL DOES NOT RETURN - EXITS!! */
return(0);
}
/*--------------------------------------------------------------*/
/***** LTP Port *****/
/* functions */
void cleanup()
{
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
*/
TEST_CLEANUP;
/* exit with return code appropriate for results */
tst_exit();
} /* End cleanup() */
void setup()
{
temp = stderr;
}
int blenter()
{
local_flag = PASSED;
return(0);
}
int blexit()
{
(local_flag == PASSED) ?
tst_resm(TPASS, "Test passed\n")
: tst_resm(TFAIL, "Test failed\n");
return(0);
}
int anyfail()
{
tst_exit();
return(0);
}
void fail_exit()
{
local_flag = FAILED;
blexit();
anyfail();
}
/***** ** ** *****/
|
|
From: <ro...@us...> - 2002-12-31 22:53:27
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls In directory sc8-pr-cvs1:/tmp/cvs-serv18276/testcases/kernel/syscalls Modified Files: Makefile Log Message: Added syscall() test ported by Ananda Venkataraman <av...@us...> Index: Makefile =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/Makefile,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- Makefile 31 Dec 2002 22:43:15 -0000 1.39 +++ Makefile 31 Dec 2002 22:53:24 -0000 1.40 @@ -53,7 +53,7 @@ setregid setresgid setresuid setreuid setrlimit setsid setsockopt \ settimeofday setuid sigaction sigaltstack sighold signal \ sigprocmask sigrelse sigsuspend socket socketpair sockioctl \ - stat statfs stime string symlink sync sysconf sysctl sysfs \ + stat statfs stime string symlink sync syscall sysconf sysctl sysfs \ sysinfo syslog time times truncate umask \ uname unlink umount utime vfork vhangup wait \ wait4 waitpid write writev |
|
From: <ro...@us...> - 2002-12-31 22:53:27
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv18276/runtest Modified Files: syscalls Log Message: Added syscall() test ported by Ananda Venkataraman <av...@us...> Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- syscalls 31 Dec 2002 22:43:14 -0000 1.93 +++ syscalls 31 Dec 2002 22:53:23 -0000 1.94 @@ -747,6 +747,8 @@ sync01 sync01 sync02 sync02 +syscall01 syscall01 + sysconf01 sysconf01 sysctl01 sysctl01 |
|
From: <ro...@us...> - 2002-12-31 22:51:47
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/syscall In directory sc8-pr-cvs1:/tmp/cvs-serv17553/syscall Log Message: Directory /cvsroot/ltp/ltp/testcases/kernel/syscalls/syscall added to the repository |
|
From: <ro...@us...> - 2002-12-31 22:43:19
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls In directory sc8-pr-cvs1:/tmp/cvs-serv12586/testcases/kernel/syscalls Modified Files: Makefile Log Message: Added string.h test string01 ported by Ananda Venkataraman <av...@us...> Index: Makefile =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/Makefile,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Makefile 30 Dec 2002 21:32:40 -0000 1.38 +++ Makefile 31 Dec 2002 22:43:15 -0000 1.39 @@ -43,7 +43,7 @@ mkdir mknod mlock mlockall mmap modify_ldt mount mprotect \ mremap msync munlock munlockall munmap nanosleep nftw nice open \ pathconf pause personality pipe poll prctl\ - pread ptrace pwrite query_module read readdir \ + pread profil ptrace pwrite query_module read readdir \ readlink readv reboot recv recvfrom recvmsg rename \ rmdir sbrk sched_get_priority_max sched_get_priority_min \ sched_getparam sched_setparam sched_getscheduler \ @@ -53,7 +53,7 @@ setregid setresgid setresuid setreuid setrlimit setsid setsockopt \ settimeofday setuid sigaction sigaltstack sighold signal \ sigprocmask sigrelse sigsuspend socket socketpair sockioctl \ - stat statfs stime symlink sync sysconf sysctl sysfs \ + stat statfs stime string symlink sync sysconf sysctl sysfs \ sysinfo syslog time times truncate umask \ uname unlink umount utime vfork vhangup wait \ wait4 waitpid write writev |
|
From: <ro...@us...> - 2002-12-31 22:43:19
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/string
In directory sc8-pr-cvs1:/tmp/cvs-serv12586/testcases/kernel/syscalls/string
Added Files:
Makefile string01.c
Log Message:
Added string.h test string01 ported by Ananda Venkataraman <av...@us...>
--- NEW FILE: Makefile ---
#
# Copyright (c) International Business Machines Corp., 2001
#
# 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
###########################################################################
# name of file : Makefile #
###########################################################################
CFLAGS+= -I../../../../include -O -g -Wall
LOADLIBES+= -L../../../../lib -lltp
SRCS=$(wildcard *.c)
TARGETS=$(patsubst %.c,%,$(SRCS))
all: $(TARGETS)
install:
@for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
clean:
rm -f $(TARGETS)
--- NEW FILE: string01.c ---
/*
*
* Copyright (c) International Business Machines Corp., 2002
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* 01/02/2003 Port to LTP av...@us... */
/* 06/30/2001 Port to Linux nsh...@us... */
/*
* NAME
* string01.c - check string functions.
*
* CALLS
* strchr, strrchr, strcat, strcmp, strcpy, strlen,
* strncat, strncmp, strncpy
*
* ALGORITHM
* Test functionality of the string functions:
* (strchr, strrchr, strcat, strcmp, strcpy, strlen,
* strncat, strncmp, strncpy )
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
/***** LTP Port *****/
#include <errno.h>
#include <stdlib.h>
#include "test.h"
#include "usctest.h"
#define FAILED 0
#define PASSED 1
char *TCID = "string01";
int local_flag = PASSED;
int block_number;
int errno;
FILE *temp;
int TST_TOTAL = 1;
extern int Tst_count;
/***** ** ** *****/
#define LONGSTR (96*1024-1)
/* #define LONGSTR (1024-1) */
/*
* Miscellaneous data strings for testing.
*/
char tiat[] = "This is a test of the string functions. ";
char yat[] = "This is yet another test.";
char tiatyat[] =
"This is a test of the string functions. This is yet another test.";
char longstr[LONGSTR+1]; /* a very long string */
char dst0[LONGSTR+1]; /* place holders for various tests */
char dst1[LONGSTR+1];
char dst2[LONGSTR+1];
/*
* Data structures for testing.
*/
/* Strlen (strlen( s ) == e_res) */
struct t_strlen {
char *s;
int e_res;
} t_len[] = {
{ "", 0 },
{ "12345", 5 },
{ tiat, 41 },
{ longstr, LONGSTR },
{NULL,0}
};
/* Index (index( s, c ) == e_res) */
struct t_index {
char *s;
char c;
char *e_res;
} t_index[] = {
{ "", 'z', (char *) NULL },
{ tiat, 'a', tiat+8 },
{ tiat, 's', tiat+3 },
{ tiat, 'o', tiat+15 },
{ tiat, 'z', (char *) NULL },
{NULL,0,NULL}
};
/* Rindex (rindex( s, c ) == e_res) */
struct t_rindex {
char *s;
char c;
char *e_res;
} t_rindex[] = {
{ "", 'z', (char *) NULL },
{ tiat, 'a', tiat+8 },
{ tiat, 's', tiat+37 },
{ tiat, 'o', tiat+35 },
{ tiat, 'z', (char *) NULL },
{NULL,0,NULL}
};
/* Strcmp (strcmp( s1, s2 ) == e_res) */
struct t_strcmp {
char *s1;
char *s2;
int e_res;
} t_cmp[] = {
{ "", "", 0 },
{ "", tiat, -((int) 'T') },
{ tiat, "", 'T' },
{ tiat, tiat, 0 },
{ yat, tiat, 'y'-'a' },
{NULL,NULL,0}
};
/* Strcat (strcmp( strcat(s1, s2), s1s2 ) == e_res) */
/* ASSUMES strcmp is working -- it is tested prior to strcat */
struct t_strcat {
char *s1;
char *s2;
char *s1s2;
int e_res;
} t_cat[] = {
{ dst0, "", "", 0 },
{ dst0, tiat, tiat, 0 },
{ dst0, "", tiat, 0 },
{ dst0, yat, tiatyat, 0 },
{ dst1, longstr,longstr, 0 },
{NULL,NULL,NULL,0}
};
/* Strcpy (strcmp( strcpy(s1, s2), s1s2 ) == e_res) */
/* ASSUMES strcmp is working -- it is tested prior to strcpy */
/* No overlapping copies are tested */
struct t_strcpy {
char *s1;
char *s2;
int e_res;
} t_cpy[] = {
{ dst0, "", 0 },
{ dst0, tiat, 0 },
{ dst0, longstr, 0 },
{NULL,NULL,0}
};
/* Strncmp (strncmp( s1, s2 ) == e_res) */
struct t_strncmp {
char *s1;
char *s2;
int n;
int e_res;
} t_ncmp[] = {
{ "", "", 0, 0 },
{ "", "", 80, 0 },
{ tiat, "", 0, 0 },
{ "", tiat, 80, -((int) 'T') },
{ tiat, "", 80, 'T' },
{ tiat, tiat, 80, 0 },
{ yat, tiat, 80, 'y'-'a' },
{ yat, tiat, 8, 0 },
{ yat, tiat, 9, 'y'-'a' },
{NULL,NULL,0,0}
};
/* Strncat (strcmp( strncat(s1, s2, n), s1ns2 ) == e_res) */
/* ASSUMES strcmp is working -- it is tested prior to strncat */
/* dest is guaranteed to be all '\0' s at start of test */
struct t_strncat {
char *s1;
char *s2;
int n;
char *s1ns2;
int e_res;
} t_ncat[] = {
/* Regular strcat stuff -- i.e., n is large enough */
{ dst0, "", LONGSTR, "", 0 },
{ dst0, tiat, LONGSTR, tiat, 0 },
{ dst0, "", LONGSTR, tiat, 0 },
{ dst0, yat, LONGSTR, tiatyat,0 },
{ dst1, longstr,LONGSTR, longstr,0 },
/* Restricted strcat stuff */
{ dst2, longstr,0, "", 0 },
{ dst2, longstr,1, "t", 0 },
{ dst2, longstr,LONGSTR-1, longstr,0 },
{NULL,NULL,0,NULL,0}
};
/* Strncpy (strcmp( strncpy(s1, s2), s1n ) == e_res) */
/* ASSUMES strcmp is working -- it is tested prior to strncpy */
/* No overlapping copies are tested */
struct t_strncpy {
char *s1;
char *s2;
int n;
char *s1n;
int e_res;
} t_ncpy[] = {
/* Regular strcpy stuff -- i.e., n is large enough */
{ dst0, "", LONGSTR, "", 0 },
{ dst0, tiat, LONGSTR, tiat, 0 },
{ dst0, longstr,LONGSTR, longstr,0 },
/* Restricted strcpy stuff */
{ dst1, tiat, 0, "", 0 },
{ dst1, longstr,5, "ttttt",0 },
{NULL,NULL,0,NULL,0}
};
/***** LTP Port *****/
void setup();
int blenter();
int blexit();
int anyfail();
void setup()
{
temp = stderr;
}
int blenter()
{
local_flag = PASSED;
return(0);
}
int blexit()
{
(local_flag == PASSED ) ? tst_resm(TPASS, "Test passed\n") : tst_resm(TFAIL, "Test failed\n");
return(0);
}
int anyfail()
{
tst_exit();
return(0);
}
/***** ** ** *****/
/*--------------------------------------------------------------*/
int main (argc, argv)
int argc;
char *argv[];
{
register int n, i;
char *s, *pr;
/*
* Init longstr
*/
s = longstr;
n = LONGSTR;
while ( n-- )
*s++ = 't';
*s = '\0';
setup();
/*--------------------------------------------------------------*/
/*
* Index
*/
//fprintf(temp, "\tStrchr\n" );
i = 0;
while ( t_index[i].s ) {
if ((pr = strchr( t_index[i].s, t_index[i].c )) != t_index[i].e_res){
fprintf(temp, "\t(Strchr) test %d: expected 0x%x, got 0x%x\n",
i, (unsigned int)t_index[i].e_res, (unsigned int)pr );
local_flag = FAILED;
}
i++;
}
/*
* Strrchr
*/
//fprintf(temp, "\tStrrchr\n" );
i = 0;
while ( t_rindex[i].s ) {
if ((pr = strrchr( t_rindex[i].s, t_rindex[i].c ))
!= t_rindex[i].e_res) {
fprintf(temp, "\t(Strrchr) test %d: expected 0x%x, got 0x%x\n",
i, (unsigned int)t_rindex[i].e_res, (unsigned int)pr );
local_flag = FAILED;
}
i++;
}
/*
* Strlen
*/
//fprintf(temp, "\tStrlen\n" );
i = 0;
while ( t_len[i].s ) {
if ((n = strlen( t_len[i].s )) != t_len[i].e_res) {
fprintf(temp, "\t(Strlen) test %d: expected %d, got %d\n",
i, t_len[i].e_res, n );
local_flag = FAILED;
}
i++;
}
/*
* Strcmp
*/
//fprintf(temp, "\tStrcmp\n" );
i = 0;
#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
while ( t_cmp[i].s1 ) {
n = strcmp( t_cmp[i].s1, t_cmp[i].s2 );
if (sign(n) != sign(t_cmp[i].e_res)) {
fprintf(temp, "\t(Strcmp) test %d: expected %d, got %d\n",
i, sign(t_cmp[i].e_res), sign(n) );
local_flag = FAILED;
}
i++;
}
/*
* Strcat
*/
//fprintf(temp, "\tStrcat\n" );
memset( dst0, 0, LONGSTR+1 ); /* clean slate */
memset( dst1, 0, LONGSTR+1 ); /* clean slate */
i = 0;
while ( t_cat[i].s1 ) {
if ((n = strcmp( strcat(t_cat[i].s1, t_cat[i].s2), t_cat[i].s1s2))
!= t_cat[i].e_res) {
fprintf(temp, "\t(Strcat) test %d: expected %d, got %d\n",
i, t_cat[i].e_res, n );
local_flag = FAILED;
}
i++;
}
/*
* Strcpy
*/
//fprintf(temp, "\tStrcpy\n" );
i = 0;
while ( t_cpy[i].s1 ) {
if ((n = strcmp( strcpy(t_cpy[i].s1, t_cpy[i].s2), t_cpy[i].s2))
!= t_cpy[i].e_res) {
fprintf(temp, "(Strcpy) test %d: expected %d, got %d\n",
i, t_cpy[i].e_res, n );
local_flag = FAILED;
}
i++;
}
/*
* Strncat
*/
//fprintf(temp, "\tStrncat\n" );
memset( dst0, 0, LONGSTR+1 ); /* clean slate */
memset( dst1, 0, LONGSTR+1 ); /* clean slate */
memset( dst2, 0, LONGSTR+1 ); /* clean slate */
i = 0;
while ( t_ncat[i].s1 ) {
if ((n = strcmp( strncat(t_ncat[i].s1,t_ncat[i].s2,t_ncat[i].n),
t_ncat[i].s1ns2)) != t_ncat[i].e_res) {
fprintf(temp, "\t(Strncat) test %d: expected %d, got %d\n",
i, t_ncat[i].e_res, n );
local_flag = FAILED;
}
i++;
}
/*
* Strncmp
*/
//fprintf(temp, "\tStrncmp\n" );
i = 0;
while ( t_ncmp[i].s1 ) {
if ((n = strncmp( t_ncmp[i].s1, t_ncmp[i].s2, t_ncmp[i].n ))
!= t_ncmp[i].e_res) {
fprintf(temp, "(Strncmp) test %d: expected %d, got %d\n",
i, t_ncmp[i].e_res, n );
local_flag = FAILED;
}
i++;
}
/*
* Strncpy
*/
//fprintf(temp, "\tStrncpy\n" );
i = 0;
memset( dst0, 0, LONGSTR+1 ); /* clean slate */
memset( dst1, 0, LONGSTR+1 ); /* clean slate */
while ( t_ncpy[i].s1 ) {
if ((n = strcmp( strncpy(t_ncpy[i].s1, t_ncpy[i].s2, t_ncpy[i].n),
t_ncpy[i].s1n)) != t_ncpy[i].e_res) {
fprintf(temp, "\t(Strncpy) test %d: expected %d, got %d\n",
i, t_ncpy[i].e_res, n );
local_flag = FAILED;
}
i++;
}
blexit();
anyfail();
return(0);
}
|
|
From: <ro...@us...> - 2002-12-31 22:43:18
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv12586/runtest Modified Files: syscalls Log Message: Added string.h test string01 ported by Ananda Venkataraman <av...@us...> Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- syscalls 31 Dec 2002 22:12:26 -0000 1.92 +++ syscalls 31 Dec 2002 22:43:14 -0000 1.93 @@ -736,6 +736,8 @@ #stime01 stime01 stime02 stime02 +string01 string01 + symlink01 symlink01 symlink02 symlink02 symlink03 symlink03 |
|
From: <ro...@us...> - 2002-12-31 22:40:42
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/string In directory sc8-pr-cvs1:/tmp/cvs-serv11513/string Log Message: Directory /cvsroot/ltp/ltp/testcases/kernel/syscalls/string added to the repository |
|
From: <ro...@us...> - 2002-12-31 22:17:09
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/profil In directory sc8-pr-cvs1:/tmp/cvs-serv30217 Modified Files: profil01.c Log Message: Added copyright info Index: profil01.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/profil/profil01.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- profil01.c 31 Dec 2002 22:12:27 -0000 1.1 +++ profil01.c 31 Dec 2002 22:17:05 -0000 1.2 @@ -1,3 +1,22 @@ +/* + * + * Copyright (c) International Business Machines Corp., 2002 + * + * 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + /* 01/02/2003 Port to LTP av...@us... */ /* 06/30/2001 Port to Linux nsh...@us... */ |
|
From: <ro...@us...> - 2002-12-31 22:12:30
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv27000/runtest Modified Files: syscalls Log Message: Added profil() test ported by Ananda Venkataraman <av...@us...> Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- syscalls 31 Dec 2002 21:58:11 -0000 1.91 +++ syscalls 31 Dec 2002 22:12:26 -0000 1.92 @@ -479,6 +479,8 @@ pread02 pread02 pread03 pread03 +profil01 profil01 + ptrace01 ptrace01 ptrace02 ptrace02 ptrace03 ptrace03 |
|
From: <ro...@us...> - 2002-12-31 22:12:30
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/profil
In directory sc8-pr-cvs1:/tmp/cvs-serv27000/testcases/kernel/syscalls/profil
Added Files:
Makefile profil01.c
Log Message:
Added profil() test ported by Ananda Venkataraman <av...@us...>
--- NEW FILE: Makefile ---
#
# Copyright (c) International Business Machines Corp., 2001
#
# 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
###########################################################################
# name of file : Makefile #
###########################################################################
CFLAGS+= -I../../../../include -O -g -Wall
LOADLIBES+= -L../../../../lib -lltp
SRCS=$(wildcard *.c)
TARGETS=$(patsubst %.c,%,$(SRCS))
all: $(TARGETS)
install:
@for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
clean:
rm -f $(TARGETS)
--- NEW FILE: profil01.c ---
/* 01/02/2003 Port to LTP av...@us... */
/* 06/30/2001 Port to Linux nsh...@us... */
/*
* NAME
* profil1.c -- test profil procedure
*
* CALLS
* profil(2), alarm(2), signal(2)
*
* ALGORITHM
* Set up a profiling buffer, turn profiling on, set a timer for
* cpu time, spin the pc and wait for timer to go off.
* The profiling buffer should contain some info, highly concentrated.
* We just do a "looks reasonable" check.
*
* RESTRICTIONS
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <stdio.h>
#include <signal.h>
/***** LTP Port *****/
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "test.h"
#include "usctest.h"
#define FAILED 0
#define PASSED 1
/***** ** ** *****/
#define P_TIME 10 /* profile for this many seconds */
extern int errno;
extern int etext;
extern char *malloc();
int t_flag;
//char progname[]= "profil1()";
/***** LTP Port *****/
char *TCID = "profil01";
int local_flag = PASSED;
int block_number;
FILE *temp;
int TST_TOTAL = 1;
extern int Tst_count;
struct sigaction sigptr;
int anyfail();
int blenter();
int blexit();
void setup();
void terror();
void fail_exit();
/***** ** ** *****/
short *pbuf;
int stuff[11];
int loops_completed;
int ucount, scount;
/*--------------------------------------------------------------*/
int main (argc, argv)
int argc;
char *argv[];
{
register int i;
int count, loc, bsize;
void alrm();
extern int _start;
int lotext = (int)&_start;
bsize = (int) &etext;
bsize -= lotext & ~ 4096;
count = loc = 0;
setup(); /* temp file is now open */
/*
if (((int)sigset(SIGALRM, alrm)) == -1) {
fprintf(temp,"signal failed. errno = %d\n",errno);
fail_exit();
}*/
sigptr.sa_handler = (void (*) (int signal))alrm;
sigfillset(&sigptr.sa_mask);
sigptr.sa_flags = 0;
sigaddset(&sigptr.sa_mask, SIGALRM);
if (sigaction(SIGALRM, &sigptr, (struct sigaction *)NULL) == -1)
{
fprintf(temp,"Signal SIGALRM failed, errno = %d \n", errno);
fail_exit();
}
/*--------------------------------------------------------------*/
blenter();
if ((pbuf = (short *) malloc(bsize*(sizeof(short))) ) == (short *) 0) {
fprintf(temp, "\tcannot malloc buffer.\n");
fail_exit();
}
for (i=0; i < bsize; i++)
pbuf[i] = 0;
if (profil(pbuf, bsize, 0, 0x10000)) {
fprintf(temp, "\tprofile (on) failed, errno = %d\n", errno);
fail_exit();
}
/*
* Set timer.
* Code will just loop in small area of text.
*/
alarm(P_TIME);
while (!t_flag) {
stuff[0] = 1;
stuff[1] = 1;
stuff[2] = 1;
stuff[3] = 1;
stuff[4] = 1;
stuff[5] = 1;
stuff[6] = 1;
stuff[7] = 1;
stuff[8] = 1;
stuff[9] = 1;
stuff[10] = 1;
loops_completed++;
}
if (profil(pbuf, bsize, 0, 0)) {
fprintf(temp, "\tprofile (off) failed, errno = %d\n", errno);
fail_exit();
}
blexit();
/*--------------------------------------------------------------*/
blenter();
for (i=0; i < bsize; i++) {
count += pbuf[i];
if (pbuf[i])
loc++;
}
ucount = count;
blexit();
/*--------------------------------------------------------------*/
blenter();
if (((int)sigset(SIGCLD, SIG_IGN)) == -1) {
fprintf(temp,"signal failed. errno = %d\n",errno);
fail_exit();
}
t_flag = 0;
setpgrp();
for (i=0; i < bsize; i++)
pbuf[i] = 0;
if (profil(pbuf, bsize, 0, 0x10000)) {
fprintf(temp, "\tprofile (on) failed, errno = %d\n", errno);
fail_exit();
}
/*
* Set timer. This loop will spend a lot of time in system code
* (searching though proc table) that won't add to our buffer
* since the pc isn't in our code.
*/
alarm(P_TIME);
while (!t_flag) {
kill(getpid(), SIGCLD);
}
if (profil(pbuf, bsize, 0, 0)) {
fprintf(temp, "\tprofile (off) failed, errno = %d\n", errno);
fail_exit();
}
count = 0;
for (i=0; i < bsize; i++) {
count += pbuf[i];
if (pbuf[i])
loc++;
}
scount = count;
if (scount > ucount) {
fprintf(temp, "\tUnexpected profiling results.\n");
fprintf(temp, "\tExpected second value to be less.\n");
local_flag = FAILED;
}
blexit();
/*--------------------------------------------------------------*/
anyfail(); /* THIS CALL DOES NOT RETURN - EXITS!! */
return(0);
}
/*--------------------------------------------------------------*/
void
alrm()
{
t_flag++;
}
/***** LTP Port *****/
int anyfail()
{
(local_flag == FAILED)? tst_resm(TFAIL, "Test failed\n"): tst_resm(TPASS, "Test passed\n");
tst_exit();
return(0);
}
void setup()
{
temp = stderr;
}
int blenter()
{
//tst_resm(TINFO, "Enter block %d\n", block_number);
local_flag = PASSED;
return(0);
}
int blexit()
{
//tst_resm(TINFO, "Exitng test\n");
(local_flag == FAILED) ? tst_resm(TFAIL, "Test failed\n") : tst_resm(TPASS, "Test passed\n");
return(0);
}
void terror(char * message)
{
tst_resm(TBROK, "Reason: %s:%s\n", message, strerror(errno));
}
void fail_exit()
{
local_flag = FAILED;
anyfail();
}
/***** ** ** *****/
|
|
From: <ro...@us...> - 2002-12-31 22:00:20
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/profil In directory sc8-pr-cvs1:/tmp/cvs-serv17415/profil Log Message: Directory /cvsroot/ltp/ltp/testcases/kernel/syscalls/profil added to the repository |
|
From: <ro...@us...> - 2002-12-31 21:58:16
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/open
In directory sc8-pr-cvs1:/tmp/cvs-serv14531/testcases/kernel/syscalls/open
Added Files:
open09.c
Log Message:
Added open() test ported by Airong Zhang <zh...@us...>
--- NEW FILE: open09.c ---
/*
*
* Copyright (c) International Business Machines Corp., 2002
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Ported from SPIE, section2/iosuite/open1.c, by Airong Zhang */
/*======================================================================
=================== TESTPLAN SEGMENT ===================
>KEYS: < open()
>WHAT: < Does a read on a file opened with oflag = O_WRONLY return -1?
< Does a write on a file opened with oflag = O_RDONLY return -1?
>HOW: < Open a file with O_WRONLY, test for -1 to pass
< Open a file with O_RDONLY, test for -1 to pass
>BUGS: < DUMMY functions used in BSD
>AUTHOR:< PERENNIAL
======================================================================*/
#include <stdio.h>
#include "test.h"
#include "usctest.h"
char *TCID = "open09";
int TST_TOTAL = 1;
extern int Tst_count;
int local_flag;
#define PASSED 1
#define FAILED 0
char progname[] = "open09()" ;
char tempfile[40]="";
/*--------------------------------------------------------------------*/
main(int ac, char *av[])
{
int fildes ;
int ret = 0 ;
char pbuf[BUFSIZ] ;
int lc; /* loop counter */
char *msg; /* message returned from parse_opts */
int fail_count = 0;
/*
* parse standard options
*/
if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
tst_exit();
/*NOTREACHED*/
}
tst_tmpdir();
local_flag = PASSED;
sprintf(tempfile, "open09.%d", getpid());
/*--------------------------------------------------------------------*/
for (lc = 0; TEST_LOOPING(lc); lc++) {
local_flag = PASSED;
block0:
if( (fildes = creat(tempfile,0600)) == -1) {
tst_resm(TBROK,"\t\t\tcan't create '%s'\n", tempfile);
tst_exit();
} else {
close(fildes);
if( (fildes = open( tempfile,1 )) == -1 ) {
tst_resm(TFAIL, "\t\t\topen failed\n" ) ;
tst_exit();
}
}
ret = read(fildes, pbuf , 1 ) ;
if( ret != -1 ) {
tst_resm(TFAIL , "read should not succeed\n") ;
local_flag = FAILED ;
}
close(fildes);
if (local_flag == PASSED) {
tst_resm(TPASS, "Test passed in block0.\n");
} else {
tst_resm(TFAIL, "Test failed in block0.\n");
fail_count++;
}
local_flag = PASSED;
/*--------------------------------------------------------------------*/
block1:
if( (fildes = open( tempfile, 0 )) == -1 ) {
tst_resm( TFAIL, "\t\t\topen failed\n" ) ;
local_flag = FAILED ;
} else {
ret = write( fildes, pbuf , 1 ) ;
if( ret != -1 )
{
tst_resm( TFAIL, "writeshould not succeed\n") ;
local_flag = FAILED ;
}
}
close(fildes);
if (local_flag == PASSED) {
tst_resm(TPASS, "Test passed in block1.\n");
} else {
tst_resm(TFAIL, "Test failed in block1.\n");
fail_count++;
}
/*--------------------------------------------------------------------*/
unlink(tempfile) ;
tst_rmdir();
if (fail_count == 0) {
tst_resm(TPASS, "Test passed.\n");
} else {
tst_resm(TFAIL, "Test failed due to above failures.\n");
}
} /* end for */
}
|
|
From: <ro...@us...> - 2002-12-31 21:58:15
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv14531/runtest Modified Files: syscalls Log Message: Added open() test ported by Airong Zhang <zh...@us...> Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- syscalls 31 Dec 2002 21:21:45 -0000 1.90 +++ syscalls 31 Dec 2002 21:58:11 -0000 1.91 @@ -450,6 +450,7 @@ open06 open06 open07 open07 open08 open08 +open09 open09 pathconf01 pathconf01 |
|
From: <ro...@us...> - 2002-12-31 21:49:13
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/creat
In directory sc8-pr-cvs1:/tmp/cvs-serv7396
Modified Files:
creat08.c
Log Message:
This test was initially ported to create users and groups that it needed. Rewrote the test
to use existing users/groups that are checked for when the LTP is installed.
Index: creat08.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/creat/creat08.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- creat08.c 30 Dec 2002 21:34:26 -0000 1.1
+++ creat08.c 31 Dec 2002 21:49:10 -0000 1.2
@@ -107,21 +107,6 @@
tst_exit();
}
- if ( (ret = system("/usr/sbin/useradd user1 -p user1")) == -1) {
- tst_resm(TBROK, "add user1 failed\n");
- tst_exit();
- }
-
- if ( (ret = system("/usr/sbin/groupadd group1")) == -1) {
- tst_resm(TBROK, "add group1 failed\n");
- tst_exit();
- }
-
- if ( (ret = system("/usr/sbin/groupadd group2")) == -1) {
- tst_resm(TBROK, "add group2 failed\n");
- tst_exit();
- }
-
for (lc = 0; TEST_LOOPING(lc); lc++) {
local_flag = PASSED;
@@ -137,8 +122,8 @@
sprintf(root_setgid_B, "%s/%s", DIR_B, ROOT_SETGID);
/* Get the uid of user1 */
- if ((user1 = getpwnam("user1")) == NULL) {
- tst_resm(TBROK, "user1 not in /etc/passwd\n");
+ if ((user1 = getpwnam("nobody")) == NULL) {
+ tst_resm(TBROK, "nobody not in /etc/passwd\n");
tst_exit();
}
@@ -147,12 +132,12 @@
/*
* Get the group IDs of group1 and group2.
*/
- if ((group = getgrnam("group1")) == NULL) {
- tst_resm(TINFO, "group1 not in /etc/group\n");
+ if ((group = getgrnam("nobody")) == NULL) {
+ tst_resm(TINFO, "nobody not in /etc/group\n");
}
group1_gid = group->gr_gid;
- if ((group = getgrnam("group2")) == NULL) {
- tst_resm(TINFO, "group2 not in /etc/group\n");
+ if ((group = getgrnam("bin")) == NULL) {
+ tst_resm(TINFO, "bin not in /etc/group\n");
}
group2_gid = group->gr_gid;
|
|
From: <ro...@us...> - 2002-12-31 21:21:49
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/kill
In directory sc8-pr-cvs1:/tmp/cvs-serv22273/testcases/kernel/syscalls/kill
Modified Files:
Makefile
Added Files:
kill11.c kill12.c
Log Message:
Added kill() tests ported by Ananda Venkataraman <av...@us...>
--- NEW FILE: kill11.c ---
/* IBM Corporation */
/* 01/02/2003 Port to LTP av...@us... */
/* 06/30/2001 Port to Linux nsh...@us... */
/*
*
* Copyright (c) International Business Machines Corp., 2002
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*kill1.c*/
/*======================================================================
>KEYS: < kill(), wait()
>WHAT: < Check that when a child is killed by its parent, it returns
< the correct values to the waiting parent--default behaviour
< assumed by child
>HOW: < For each signal: send that signal to a child, check that the
< child returns the correct value to the waiting parent.
>BUGS: <
>REQUIREMENT(S): Need to set ulimit to multiples of 1024.
======================================================================*/
#define _GNU_SOURCE 1
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
/***** LTP Port *****/
#include <errno.h>
#include "test.h"
#include "usctest.h"
#define ITER 3
#define FAILED 0
#define PASSED 1
char *TCID = "kill11";
int local_flag = PASSED;
int block_number;
FILE *temp;
int TST_TOTAL = 1;
extern int Tst_count;
int anyfail();
int blenter();
void setup();
void terror();
void fail_exit();
int forkfail();
/***** ** ** *****/
//char progname[] = "kill1()";
/*--------------------------------------------------------------------*/
int main() /***** BEGINNING OF MAIN. *****/
{
register int i;
int core;
int pid, npid;
int sig, nsig, exno, nexno, status;
int ret_val = 0;
/*SIGIOT is 6, but since linux doesn't have SIGEMT, just using
SIGIOT for place filling */
int signum[14];
int j;
signum[1]=SIGHUP; signum[2]=SIGINT; signum[3]=SIGQUIT;
signum[4]=SIGILL; signum[5]=SIGTRAP; signum[6]=SIGABRT;
signum[7]=SIGIOT; signum[8]=SIGFPE; signum[9]=SIGKILL;
signum[10]=SIGBUS; signum[11]=SIGSEGV; signum[12]=SIGSYS;
signum[13]=SIGPIPE; signum[14]=SIGALRM;
setup();
// tempdir(); /* move to new directory */
/*--------------------------------------------------------------------*/
blenter(); /*<<<<<ENTER DATA HERE<<<<<<<<*/
exno = 1;
unlink("core");
for(j = 1; j < 14; j++) {
sig=signum[j];
if (sig != SIGKILL )
#ifndef BCS
if( sig != SIGSTOP)
#endif
if (sigset(sig, SIG_DFL) == SIG_ERR) {
fprintf(temp, "\tsigset(%d,,) fails\n", sig);
local_flag = FAILED;
fail_exit();
}
fflush(temp);
pid = fork();
if (pid < 0) {
forkfail();
}
/*
* Child process sleeps for up to 3 minutes giving the
* parent process a chance to kill it.
*/
if (pid == 0) {
for (i=0; i < 180; i++)
sleep(1);
fprintf(temp, "\tChild missed sig %d\n", sig);
fflush(temp);
_exit(exno);
}
/*
* Parent process sends signal to child.
*/
//fprintf(temp, "Testing signal %d\n", sig); 12/12/02
kill (pid, sig);
npid = wait(&status);
if (npid != pid) {
fprintf(temp, "wait error: unexpected pid returned\n");
ret_val = 1;
}
/* 12/20/02.
nsig = status & 0177;
core = status & 0200;
nexno = (status & 0xff00) >> 8;
*/
/***** LTP Port *****/
nsig = WTERMSIG(status);
#ifdef WCOREDUMP
core = WCOREDUMP(status);
#endif
nexno = WIFEXITED(status);
/***** ** ** *****/
//printf("nsig=%x, core=%x, status=%x\n", nsig,core, status); 12/12/2002
/* to check if the core dump bit has been set, bit # 7 */
/***** LTP Port *****/
/* 12/12/02: av...@us...
* SIGILL when is not caught or not ignored it causes
* a core dump and program termination. So moved the condition to
* else part of the program.
* SIGQUIT like SIGABRT normally causes a program to quit and
* and dumps core. So moved the condition to else part of the
* program.
*/
/***** ** ** *****/
if (core) {
if ((sig == 1) || (sig == 2) /*|| (sig == 3) ||*/
/*(sig == 4)*/ || (sig == 9) ||
(sig == 13) || (sig == 14) || (sig == 15)) {
fprintf(temp, "signal error: core dump bit set for exception number %d\n", sig);
ret_val = 1;
}
} else {
if((sig ==3) || (sig ==4) || (sig == 5) || (sig == 6) || (sig == 7) ||
(sig == 8) || (sig == 10) || (sig == 11) ||
(sig == 12)) {
fprintf(temp, "signal error: core dump bit not set for exception number %d\n", sig);
ret_val = 1;
}
}
/* nsig is the signal number returned by wait */
if (nsig != sig) {
fprintf(temp, "wait error: unexpected signal %d returned, expected %d\n", nsig, sig);
ret_val = 1;
}
/* nexno is the exit number returned by wait */
if (nexno != 0) {
fprintf(temp, "signal error: unexpected exit number %d returned, expected 0\n", nexno);
ret_val = 1;
}
}
unlink("core");
fflush(temp);
if(ret_val)
local_flag = FAILED;
unlink("core");
tst_rmdir();
/*--------------------------------------------------------------------*/
anyfail();
return(0);
}
/****** LTP Port *****/
int anyfail()
{
(local_flag == FAILED)? tst_resm(TFAIL, "Test failed\n"): tst_resm(TPASS, "Test passed\n");
tst_exit();
return(0);
}
void setup()
{
temp = stderr;
tst_tmpdir();
}
int blenter()
{
//tst_resm(TINFO, "Enter block %d\n", block_number);
local_flag = PASSED;
return(0);
}
void terror(char * message)
{
tst_resm(TBROK, "Reason: %s:%s\n", message, strerror(errno));
}
void fail_exit()
{
local_flag = FAILED;
anyfail();
}
int forkfail()
{
tst_resm(TBROK, "FORK FAILED - terminating test.");
tst_exit();
return(0);
}
/****** ** ** *******/
--- NEW FILE: kill12.c ---
/* IBM Corporation */
/* 01/02/2003 Port to LTP av...@us... */
/* 06/30/2001 Port to Linux nsh...@us... */
/*
*
* Copyright (c) International Business Machines Corp., 2002
*
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*kill2.c*/
/*======================================================================
>KEYS: < kill(), wait(), signal()
>WHAT: < Check that when a child is killed by its parent, it returns the
< correct values to the waiting parent--the child sets signal to
< ignore the kill
>HOW: < For each signal: Send that signal to a child that has elected
< to catch the signal, check that the correct status was returned
< to the waiting parent.
< NOTE: Signal 9 (kill) is not catchable, and must be dealt with
< separately.
>BUGS: < None known
======================================================================*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <errno.h>
//char progname[] = "kill2()";
/***** LTP Port *****/
#include "test.h"
#include "usctest.h"
#define ITER 3
#define FAILED 0
#define PASSED 1
char *TCID = "kill11";
int local_flag = PASSED;
int block_number;
FILE *temp;
int TST_TOTAL = 1;
extern int Tst_count;
int anyfail();
int blenter();
int instress();
void setup();
void terror();
void fail_exit();
void ok_exit();
int forkfail();
/***** ** ** *****/
int chflag;
/*--------------------------------------------------------------------*/
int main() /***** BEGINNING OF MAIN. *****/
{
int pid, npid;
int sig, nsig, exno, nexno, status;
int ret_val = 0;
int core;
void chsig();
setup();
//tempdir(); /* move to new directory */ 12/20/2003
/*--------------------------------------------------------------------*/
blenter(); /*<<<<<ENTER DATA HERE<<<<<<<<*/
exno = 1;
if (sigset(SIGCLD, chsig) == SIG_ERR) {
fprintf(temp, "\tsigset failed, errno = %d\n", errno);
fail_exit();
}
for(sig = 1; sig < 14; sig++) {
fflush(temp);
chflag = 0;
pid = fork();
if (pid < 0) {
forkfail();
}
if (pid == 0) {
sigset(sig, SIG_IGN); /* set to ignore signal */
kill(getppid(), SIGCLD); /* tell parent we are ready */
while (!chflag)
sleep(1); /* wait for parent */
exit(exno);
} else {
//fprintf(temp, "Testing signal %d\n", sig);
while (!chflag) /* wait for child */
sleep(1);
kill (pid, sig); /* child should ignroe this sig */
kill(pid, SIGCLD); /* child should exit */
#ifdef BCS
while((npid = wait(&status)) != pid || (npid == -1 && errno == EINTR))
;
if( npid != pid ) {
fprintf(temp, "wait error: wait returned wrong pid\n");
ret_val = 1;
}
#else
while((npid = waitpid(pid, &status, 0)) != -1 || errno == EINTR)
;
#endif
/*
nsig = status & 0177;
core = status & 0200;
nexno = (status & 0xff00) >> 8;
*/
/***** LTP Port *****/
nsig = WTERMSIG(status);
#ifdef WCOREDUMP
core = WCOREDUMP(status);
#endif
nexno = WIFEXITED(status);
/***** ** ** *****/
/* nsig is the signal number returned by wait
it should be 0, except when sig = 9 */
if ((sig == 9) && (nsig != sig)) {
fprintf(temp, "wait error: unexpected signal"
" returned when the signal sent was 9"
" The status of the process is %d \n",
status);
ret_val = 1;
}
if ((sig != 9) && (nsig != 0)) {
fprintf(temp, "wait error: unexpected signal "
"returned, the status of the process is "
"%d \n",status);
ret_val = 1;
}
/* nexno is the exit number returned by wait
it should be 1, except when sig = 9 */
if (sig == 9)
if (nexno != 0) {
fprintf(temp, "signal error: unexpected"
" exit number returned when"
" signal sent was 9, the status"
" of the process is %d \n",
status);
ret_val = 1;
}
else;
else if (nexno != 1) {
fprintf(temp, "signal error: unexpected exit "
"number returned,the status of the"
" process is %d\n",status);
ret_val = 1;
}
}
}
if(ret_val)
local_flag = FAILED;
/*--------------------------------------------------------------------*/
anyfail();
return(0);
} /******** END OF MAIN. ********/
/*--------------------------------------------------------------------*/
void chsig()
{
chflag++;
}
/****** LTP Port *****/
int anyfail()
{
(local_flag == FAILED)? tst_resm(TFAIL, "Test failed\n"): tst_resm(TPASS, "Test passed\n");
tst_exit();
return(0);
}
void setup()
{
temp = stderr;
}
int blenter()
{
//tst_resm(TINFO, "Enter block %d\n", block_number);
local_flag = PASSED;
return(0);
}
void terror(char * message)
{
tst_resm(TBROK, "Reason: %s:%s\n", message, strerror(errno));
}
void fail_exit()
{
local_flag = FAILED;
anyfail();
}
int forkfail()
{
tst_resm(TBROK, "FORK FAILED - terminating test.");
tst_exit();
return(0);
}
/****** ** ** *******/
Index: Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/kill/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile 7 Feb 2002 01:32:03 -0000 1.3
+++ Makefile 31 Dec 2002 21:21:45 -0000 1.4
@@ -19,7 +19,7 @@
###########################################################################
# name of file : Makefile #
###########################################################################
-CFLAGS+= -I../../../../include
+CFLAGS+= -I../../../../include -Wall -g -D_GNU_SOURCE
LOADLIBES+= -L../../../../lib -lltp -L.. -ltestsuite -L../ipc -lipc
SRCS=$(wildcard *.c)
|
|
From: <ro...@us...> - 2002-12-31 21:21:48
|
Update of /cvsroot/ltp/ltp/runtest In directory sc8-pr-cvs1:/tmp/cvs-serv22273/runtest Modified Files: syscalls Log Message: Added kill() tests ported by Ananda Venkataraman <av...@us...> Index: syscalls =================================================================== RCS file: /cvsroot/ltp/ltp/runtest/syscalls,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- syscalls 30 Dec 2002 21:32:36 -0000 1.89 +++ syscalls 31 Dec 2002 21:21:45 -0000 1.90 @@ -290,6 +290,8 @@ kill08 kill08 kill09 kill09 kill10 kill10 +kill11 ulimit -c 1024;kill11;ulimit -c 0 +kill12 kill12 lchown01 lchown01 lchown02 cp -p $LTPROOT/testcases/bin/create_link $TMP; lchown02 |