public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend.
@ 2010-11-11  4:02 Bian Naimeng
  2010-11-11  4:06 ` [LTP] [POSIX][PATCH 1/4]Get rid of aio_suspend/6-1 Bian Naimeng
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Bian Naimeng @ 2010-11-11  4:02 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

Some aio_suspend tests are redundantly, so we should remove them.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

------

 .../conformance/interfaces/aio_suspend/6-1.c       |  217 ------------------
 .../conformance/interfaces/aio_suspend/7-1.c       |  242 --------------------
 .../conformance/interfaces/aio_suspend/8-1.c       |  240 -------------------
 .../conformance/interfaces/aio_suspend/9-1.c       |  242 --------------------
 4 files changed, 0 insertions(+), 941 deletions(-)


------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP]  [POSIX][PATCH 1/4]Get rid of aio_suspend/6-1
  2010-11-11  4:02 [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Bian Naimeng
@ 2010-11-11  4:06 ` Bian Naimeng
  2010-11-11  4:07 ` [LTP] [POSIX][PATCH 2/4]Get rid of aio_suspend/7-1 Bian Naimeng
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2010-11-11  4:06 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

aio_suspend/6-1 is same as 1-1,so remove it.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 .../conformance/interfaces/aio_suspend/6-1.c       |  217 --------------------
 1 files changed, 0 insertions(+), 217 deletions(-)
 delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/6-1.c

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/6-1.c
deleted file mode 100644
index bc464c8..0000000
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/6-1.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2004, Bull SA. All rights reserved.
- * Created by:  Laurent.Vivier@bull.net
- * This file is licensed under the GPL license.  For the full content
- * of this license, see the COPYING file at the top level of this 
- * source tree.
- */
-
-/*
- * assertion:
- *
- *	aio_supend() shall return zero after one or more AIO operations have 
- *	completed.
- *
- * method:
- *
- *	- write to a file
- *	- submit a list of read requests
- *	- suspend on a selected request
- *	- check return code
- *
- */
-
-#define _XOPEN_SOURCE 600
-#include <sys/stat.h>
-#include <aio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "posixtest.h"
-
-#define TNAME "aio_suspend/6-1.c"
-
-#define NUM_AIOCBS	10
-#define BUF_SIZE	1024*1024
-#define WAIT_FOR_AIOCB	6
-
-int received_selected	= 0;
-int received_all	= 0;
-
-void
-sigrt1_handler(int signum, siginfo_t *info, void *context)
-{
-	if (info->si_value.sival_int == WAIT_FOR_AIOCB)
-		received_selected = 1;
-}
-
-void
-sigrt2_handler(int signum, siginfo_t *info, void *context)
-{
-	received_all = 1;
-}
-
-int
-main ()
-{
-	char tmpfname[256];
-	int fd;
-
-	struct aiocb **aiocbs;
-	struct aiocb *plist[2];
-	char *bufs;
-	struct sigaction action;
-	struct sigevent event;
-	int errors = 0;
-	int ret;
-	int err;
-	int i;
-
-	if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L)
-		return PTS_UNSUPPORTED;
-
-	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_suspend_6_1_%d", 
-		  getpid());
-	unlink(tmpfname);
-
-	fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
-
-	if (fd == -1) {
-		printf(TNAME " Error at open(): %s\n",
-		       strerror(errno));
-		exit(PTS_UNRESOLVED);
-	}
-
-	unlink(tmpfname);
-
-	bufs = (char *) malloc (NUM_AIOCBS*BUF_SIZE);
-
-	if (bufs == NULL) {
-		printf (TNAME " Error at malloc(): %s\n", strerror (errno));
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-	if (write (fd, bufs, NUM_AIOCBS*BUF_SIZE) != (NUM_AIOCBS*BUF_SIZE)) {
-		printf(TNAME " Error at write(): %s\n", strerror(errno));
-		free (bufs);
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-
-
-	aiocbs = (struct aiocb**)malloc(sizeof(struct aiocb *) * NUM_AIOCBS);
-
-	/* Queue up a bunch of aio reads */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-
-		aiocbs[i] = (struct aiocb*)malloc(sizeof(struct aiocb));
-		memset(aiocbs[i], 0, sizeof(struct aiocb));
-
-		aiocbs[i]->aio_fildes = fd;
-		aiocbs[i]->aio_offset = i * BUF_SIZE;
-		aiocbs[i]->aio_buf = &bufs[i*BUF_SIZE];
-		aiocbs[i]->aio_nbytes = BUF_SIZE;
-		aiocbs[i]->aio_lio_opcode = LIO_READ;
-
-		/* Use SIRTMIN+1 for individual completions */
-		aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
-		aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
-		aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
-	}
-
-	/* Use SIGRTMIN+2 for list completion */
-	event.sigev_notify = SIGEV_SIGNAL;
-	event.sigev_signo = SIGRTMIN+2;
-	event.sigev_value.sival_ptr = NULL;
-
-	/* Setup handler for individual operation completion */
-	action.sa_sigaction = sigrt1_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+1, &action, NULL);
-
-	/* Setup handler for list completion */
-	action.sa_sigaction = sigrt2_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+2, &action, NULL);
-
-	/* Setup suspend list */
-	plist[0] = NULL;
-	plist[1] = aiocbs[WAIT_FOR_AIOCB];
-
-	/* Submit request list */
-	ret = lio_listio(LIO_NOWAIT, aiocbs, NUM_AIOCBS, &event);
-
-	if (ret) {
-		printf(TNAME " Error at lio_listio() %d: %s\n", errno, strerror(errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_UNRESOLVED);
-	}
-
-	/* Suspend on selected request */
-	ret = aio_suspend((const struct aiocb **)plist, 2, NULL);
-
-	/* Check selected request has completed */
-	if (!received_selected) {
-		printf (TNAME " Error : AIOCB %d should have completed after suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-
-	if (ret) {
-		printf (TNAME " Error at aio_suspend() %d: %s\n", errno, strerror (errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Wait for list processing completion */
-	while (!received_all)
-		sleep (1);
-
-	/* Check return code and free things */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-	  	err = aio_error(aiocbs[i]);
-		ret = aio_return(aiocbs[i]);
-
-		if ((err != 0) && (ret != BUF_SIZE)) {
-			printf(TNAME " req %d: error = %d - return = %d\n", i, err, ret);
-			errors++;
-		}
-
-		free (aiocbs[i]);
-	}
-
-	free (bufs);
-	free (aiocbs);
-
-	close(fd);
-
-	if (errors != 0)
-		exit (PTS_FAIL);
-
-	printf (TNAME " PASSED\n");
-
-	return PTS_PASS;
-}
-- 
1.7.0.4




------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [LTP]  [POSIX][PATCH 2/4]Get rid of aio_suspend/7-1
  2010-11-11  4:02 [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Bian Naimeng
  2010-11-11  4:06 ` [LTP] [POSIX][PATCH 1/4]Get rid of aio_suspend/6-1 Bian Naimeng
@ 2010-11-11  4:07 ` Bian Naimeng
  2010-11-11  4:13 ` [LTP] [POSIX][PATCH 3/4]Get rid of aio_suspend/8-1 Bian Naimeng
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2010-11-11  4:07 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

aio_suspend/7-1 is same as 4-1, so remove it.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 .../conformance/interfaces/aio_suspend/7-1.c       |  242 --------------------
 1 files changed, 0 insertions(+), 242 deletions(-)
 delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/7-1.c

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/7-1.c
deleted file mode 100644
index 83a6a00..0000000
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/7-1.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (c) 2004, Bull SA. All rights reserved.
- * Created by:  Laurent.Vivier@bull.net
- * This file is licensed under the GPL license.  For the full content
- * of this license, see the COPYING file at the top level of this 
- * source tree.
- */
-
-/*
- * assertion:
- *
- *	aio_suspend() shall return the value -1 and set errno to indicate error
- *	if it returns before at least one AIO operation have completed.
- *
- * method: Testing for a non NULL timeout
- *
- *	- write to a file
- *	- submit a list of read requests
- *	- check that the selected request has not completed
- *	- suspend on selected request
- *	- check that the suspend timed out
- *	- check that aio_suspend returns -1 and errno is set to EAGAIN
- */
-
-#define _XOPEN_SOURCE 600
-#include <sys/stat.h>
-#include <aio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "posixtest.h"
-
-#define TNAME "aio_suspend/7-1.c"
-
-#define NUM_AIOCBS	10
-#define BUF_SIZE	1024*1024
-#define WAIT_FOR_AIOCB	6
-
-int received_selected	= 0;
-int received_all	= 0;
-
-void
-sigrt1_handler(int signum, siginfo_t *info, void *context)
-{
-	if (info->si_value.sival_int == WAIT_FOR_AIOCB)
-		received_selected = 1;
-}
-
-void
-sigrt2_handler(int signum, siginfo_t *info, void *context)
-{
-	received_all = 1;
-}
-
-int
-main ()
-{
-	char tmpfname[256];
-	int fd;
-
-	struct aiocb **aiocbs;
-	struct aiocb *plist[2];
-	char *bufs;
-	struct sigaction action;
-	struct sigevent event;
-	struct timespec ts = {0, 10000000}; /* 10 ms */
-	int errors = 0;
-	int ret;
-	int err;
-	int i;
-
-	if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L)
-		return PTS_UNSUPPORTED;
-
-	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_suspend_7_1_%d", 
-		  getpid());
-	unlink(tmpfname);
-
-	fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
-
-	if (fd == -1) {
-		printf(TNAME " Error at open(): %s\n",
-		       strerror(errno));
-		exit(PTS_UNRESOLVED);
-	}
-
-	unlink(tmpfname);
-
-	bufs = (char *) malloc (NUM_AIOCBS*BUF_SIZE);
-
-	if (bufs == NULL) {
-		printf (TNAME " Error at malloc(): %s\n", strerror (errno));
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-	if (write (fd, bufs, NUM_AIOCBS*BUF_SIZE) != (NUM_AIOCBS*BUF_SIZE)) {
-		printf(TNAME " Error at write(): %s\n", strerror(errno));
-		free (bufs);
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-
-
-	aiocbs = (struct aiocb**)malloc(sizeof(struct aiocb *) * NUM_AIOCBS);
-
-	/* Queue up a bunch of aio reads */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-
-		aiocbs[i] = (struct aiocb*)malloc(sizeof(struct aiocb));
-		memset(aiocbs[i], 0, sizeof(struct aiocb));
-
-		aiocbs[i]->aio_fildes = fd;
-		aiocbs[i]->aio_offset = i * BUF_SIZE;
-		aiocbs[i]->aio_buf = &bufs[i*BUF_SIZE];
-		aiocbs[i]->aio_nbytes = BUF_SIZE;
-		aiocbs[i]->aio_lio_opcode = LIO_READ;
-
-		/* Use SIRTMIN+1 for individual completions */
-		aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
-		aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
-		aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
-	}
-
-	/* Use SIGRTMIN+2 for list completion */
-	event.sigev_notify = SIGEV_SIGNAL;
-	event.sigev_signo = SIGRTMIN+2;
-	event.sigev_value.sival_ptr = NULL;
-
-	/* Setup handler for individual operation completion */
-	action.sa_sigaction = sigrt1_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+1, &action, NULL);
-
-	/* Setup handler for list completion */
-	action.sa_sigaction = sigrt2_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+2, &action, NULL);
-
-	/* Setup suspend list */
-	plist[0] = NULL;
-	plist[1] = aiocbs[WAIT_FOR_AIOCB];
-
-	/* Submit request list */
-	ret = lio_listio(LIO_NOWAIT, aiocbs, NUM_AIOCBS, &event);
-
-	if (ret) {
-		printf(TNAME " Error at lio_listio() %d: %s\n", errno, strerror(errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_UNRESOLVED);
-	}
-
-	/* Check selected request has not completed yet */
-	if (received_selected) {
-		printf (TNAME " Error : AIOCB %d already completed before suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Suspend on selected request */
-	ret = aio_suspend((const struct aiocb **)plist, 2, &ts);
-
-	/* Check selected request has not completed */
-	if (received_selected) {
-		printf (TNAME " Error : AIOCB %d should not have completed after timed out suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* timed out aio_suspend should return -1 and set errno to EAGAIN */
-	if (ret != -1) {
-		printf (TNAME " aio_suspend() should return -1\n");
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	if (errno != EAGAIN) {
-		printf (TNAME " aio_suspend() should set errno to EAGAIN: %d (%s)\n",
-			errno, strerror (errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Wait for list processing completion */
-	while (!received_all)
-		sleep (1);
-
-	/* Check return code and free things */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-	  	err = aio_error(aiocbs[i]);
-		ret = aio_return(aiocbs[i]);
-
-		if ((err != 0) && (ret != BUF_SIZE)) {
-			printf(TNAME " req %d: error = %d - return = %d\n", i, err, ret);
-			errors++;
-		}
-
-		free (aiocbs[i]);
-	}
-
-	free (bufs);
-	free (aiocbs);
-
-	close(fd);
-
-	if (errors != 0)
-		exit (PTS_FAIL);
-
-	printf (TNAME " PASSED\n");
-
-	return PTS_PASS;
-}
-- 
1.7.0.4




------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [LTP]  [POSIX][PATCH 3/4]Get rid of aio_suspend/8-1
  2010-11-11  4:02 [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Bian Naimeng
  2010-11-11  4:06 ` [LTP] [POSIX][PATCH 1/4]Get rid of aio_suspend/6-1 Bian Naimeng
  2010-11-11  4:07 ` [LTP] [POSIX][PATCH 2/4]Get rid of aio_suspend/7-1 Bian Naimeng
@ 2010-11-11  4:13 ` Bian Naimeng
  2010-11-11  4:14 ` [LTP] [POSIX][PATCH 4/4]Get rid of aio_suspend/9-1 Bian Naimeng
  2010-11-11 10:10 ` [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Garrett Cooper
  4 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2010-11-11  4:13 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

If following patch be applied, aio_suspend/8-1 is same as 1-1, i suggest to remove it.

http://sourceforge.net/mailarchive/forum.php?thread_name=4CDB5E53.6070604%40cn.fujitsu.com&forum_name=ltp-list

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 .../conformance/interfaces/aio_suspend/8-1.c       |  240 --------------------
 1 files changed, 0 insertions(+), 240 deletions(-)
 delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/8-1.c

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/8-1.c
deleted file mode 100644
index 0023520..0000000
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/8-1.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2004, Bull SA. All rights reserved.
- * Created by:  Laurent.Vivier@bull.net
- * This file is licensed under the GPL license.  For the full content
- * of this license, see the COPYING file at the top level of this 
- * source tree.
- */
-
-/*
- * assertion:
- *
- *	The aio_suspend() function shall suspend the calling thread until at
- *	least one of the asynchronous I/O operations referenced by the list
- *	argument has completed, until a signal interrupts the function, or,
- *	if timeout is not NULL, until the time interval specified by timeout
- *	has passed.
- *
- * method: Testing for a NULL timeout
- *
- *	- write to a file
- *	- submit a list of read requests
- *	- check that the selected request has not completed
- *	- suspend on selected request
- *	- check that the selected request has completed using aio_error and
- *	  aio_return
- *
- */
-
-#define _XOPEN_SOURCE 600
-#include <sys/stat.h>
-#include <aio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "posixtest.h"
-
-#define TNAME "aio_suspend/8-1.c"
-
-#define NUM_AIOCBS	10
-#define BUF_SIZE	1024*1024
-#define WAIT_FOR_AIOCB	6
-
-int received_selected	= 0;
-int received_all	= 0;
-
-void
-sigrt1_handler(int signum, siginfo_t *info, void *context)
-{
-	if (info->si_value.sival_int == WAIT_FOR_AIOCB)
-		received_selected = 1;
-}
-
-void
-sigrt2_handler(int signum, siginfo_t *info, void *context)
-{
-	received_all = 1;
-}
-
-int
-main ()
-{
-	char tmpfname[256];
-	int fd;
-
-	struct aiocb **aiocbs;
-	struct aiocb *plist[2];
-	char *bufs;
-	struct sigaction action;
-	struct sigevent event;
-	int errors = 0;
-	int ret;
-	int err;
-	int i;
-
-	if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L)
-		return PTS_UNSUPPORTED;
-
-	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_suspend_8_1_%d", 
-		  getpid());
-	unlink(tmpfname);
-
-	fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
-
-	if (fd == -1) {
-		printf(TNAME " Error at open(): %s\n",
-		       strerror(errno));
-		exit(PTS_UNRESOLVED);
-	}
-
-	unlink(tmpfname);
-
-	bufs = (char *) malloc (NUM_AIOCBS*BUF_SIZE);
-
-	if (bufs == NULL) {
-		printf (TNAME " Error at malloc(): %s\n", strerror (errno));
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-	if (write (fd, bufs, NUM_AIOCBS*BUF_SIZE) != (NUM_AIOCBS*BUF_SIZE)) {
-		printf(TNAME " Error at write(): %s\n", strerror(errno));
-		free (bufs);
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-
-
-	aiocbs = (struct aiocb**)malloc(sizeof(struct aiocb *) * NUM_AIOCBS);
-
-	/* Queue up a bunch of aio reads */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-
-		aiocbs[i] = (struct aiocb*)malloc(sizeof(struct aiocb));
-		memset(aiocbs[i], 0, sizeof(struct aiocb));
-
-		aiocbs[i]->aio_fildes = fd;
-		aiocbs[i]->aio_offset = i * BUF_SIZE;
-		aiocbs[i]->aio_buf = &bufs[i*BUF_SIZE];
-		aiocbs[i]->aio_nbytes = BUF_SIZE;
-		aiocbs[i]->aio_lio_opcode = LIO_READ;
-
-		/* Use SIRTMIN+1 for individual completions */
-		aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
-		aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
-		aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
-	}
-
-	/* Use SIGRTMIN+2 for list completion */
-	event.sigev_notify = SIGEV_SIGNAL;
-	event.sigev_signo = SIGRTMIN+2;
-	event.sigev_value.sival_ptr = NULL;
-
-	/* Setup handler for individual operation completion */
-	action.sa_sigaction = sigrt1_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+1, &action, NULL);
-
-	/* Setup handler for list completion */
-	action.sa_sigaction = sigrt2_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+2, &action, NULL);
-
-	/* Setup suspend list */
-	plist[0] = NULL;
-	plist[1] = aiocbs[WAIT_FOR_AIOCB];
-
-	/* Submit request list */
-	ret = lio_listio(LIO_NOWAIT, aiocbs, NUM_AIOCBS, &event);
-
-	if (ret) {
-		printf(TNAME " Error at lio_listio() %d: %s\n", errno, strerror(errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_UNRESOLVED);
-	}
-
-	/* Check selected request has not completed yet */
-	if (received_selected) {
-		printf (TNAME " Error : AIOCB %d already completed before suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Suspend on selected request */
-	ret = aio_suspend((const struct aiocb **)plist, 2, NULL);
-
-	if (ret) {
-		printf (TNAME " Error at aio_suspend() %d: %s\n", errno, strerror (errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Check selected request has completed */
-	err = aio_error (aiocbs[WAIT_FOR_AIOCB]);
-	ret = aio_return (aiocbs[WAIT_FOR_AIOCB]);
-	
-	if ((err != 0) && (ret !=  BUF_SIZE)) {
-		printf (TNAME " Error : AIOCB %d should have completed after suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-
-	/* Wait for list processing completion */
-	while (!received_all)
-		sleep (1);
-
-	/* Check return code and free things */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-		if (i == WAIT_FOR_AIOCB)
-			continue;
-
-	  	err = aio_error(aiocbs[i]);
-		ret = aio_return(aiocbs[i]);
-
-		if ((err != 0) && (ret != BUF_SIZE)) {
-			printf(TNAME " req %d: error = %d - return = %d\n", i, err, ret);
-			errors++;
-		}
-
-		free (aiocbs[i]);
-	}
-
-	free (bufs);
-	free (aiocbs);
-
-	close(fd);
-
-	if (errors != 0)
-		exit (PTS_FAIL);
-
-	printf (TNAME " PASSED\n");
-
-	return PTS_PASS;
-}
-- 
1.7.0.4




------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [LTP]  [POSIX][PATCH 4/4]Get rid of aio_suspend/9-1
  2010-11-11  4:02 [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Bian Naimeng
                   ` (2 preceding siblings ...)
  2010-11-11  4:13 ` [LTP] [POSIX][PATCH 3/4]Get rid of aio_suspend/8-1 Bian Naimeng
@ 2010-11-11  4:14 ` Bian Naimeng
  2010-11-11 10:10 ` [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Garrett Cooper
  4 siblings, 0 replies; 7+ messages in thread
From: Bian Naimeng @ 2010-11-11  4:14 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

aio_suspend/9-1 is same as 4-1, so remove it.

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 .../conformance/interfaces/aio_suspend/9-1.c       |  242 --------------------
 1 files changed, 0 insertions(+), 242 deletions(-)
 delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c
deleted file mode 100644
index 39d504d..0000000
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (c) 2004, Bull SA. All rights reserved.
- * Created by:  Laurent.Vivier@bull.net
- * This file is licensed under the GPL license.  For the full content
- * of this license, see the COPYING file at the top level of this 
- * source tree.
- */
-
-/*
- * assertion:
- *
- *	aio_suspend() shall fail if:
-	[EAGAIN] No AIO indicated in the list completed before timeout
- *
- * method:
- *
- *	- write to a file
- *	- submit a list of read requests
- *	- check that the selected request has not completed
- *	- suspend on selected request
- *	- check that the suspend timed out and returned EAGAIN
- *
- */
-
-#define _XOPEN_SOURCE 600
-#include <sys/stat.h>
-#include <aio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "posixtest.h"
-
-#define TNAME "aio_suspend/9-1.c"
-
-#define NUM_AIOCBS	10
-#define BUF_SIZE	1024*1024
-#define WAIT_FOR_AIOCB	6
-
-int received_selected	= 0;
-int received_all	= 0;
-
-void
-sigrt1_handler(int signum, siginfo_t *info, void *context)
-{
-	if (info->si_value.sival_int == WAIT_FOR_AIOCB)
-		received_selected = 1;
-}
-
-void
-sigrt2_handler(int signum, siginfo_t *info, void *context)
-{
-	received_all = 1;
-}
-
-int
-main ()
-{
-	char tmpfname[256];
-	int fd;
-
-	struct aiocb **aiocbs;
-	struct aiocb *plist[2];
-	char *bufs;
-	struct sigaction action;
-	struct sigevent event;
-	struct timespec ts = {0, 10000000}; /* 10 ms */
-	int errors = 0;
-	int ret;
-	int err;
-	int i;
-
-	if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L)
-		return PTS_UNSUPPORTED;
-
-	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_aio_suspend_9_1_%d", 
-		  getpid());
-	unlink(tmpfname);
-
-	fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
-
-	if (fd == -1) {
-		printf(TNAME " Error at open(): %s\n",
-		       strerror(errno));
-		exit(PTS_UNRESOLVED);
-	}
-
-	unlink(tmpfname);
-
-	bufs = (char *) malloc (NUM_AIOCBS*BUF_SIZE);
-
-	if (bufs == NULL) {
-		printf (TNAME " Error at malloc(): %s\n", strerror (errno));
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-	if (write (fd, bufs, NUM_AIOCBS*BUF_SIZE) != (NUM_AIOCBS*BUF_SIZE)) {
-		printf(TNAME " Error at write(): %s\n", strerror(errno));
-		free (bufs);
-		close (fd);
-		exit(PTS_UNRESOLVED);
-	}
-
-
-
-	aiocbs = (struct aiocb**)malloc(sizeof(struct aiocb *) * NUM_AIOCBS);
-
-	/* Queue up a bunch of aio reads */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-
-		aiocbs[i] = (struct aiocb*)malloc(sizeof(struct aiocb));
-		memset(aiocbs[i], 0, sizeof(struct aiocb));
-
-		aiocbs[i]->aio_fildes = fd;
-		aiocbs[i]->aio_offset = i * BUF_SIZE;
-		aiocbs[i]->aio_buf = &bufs[i*BUF_SIZE];
-		aiocbs[i]->aio_nbytes = BUF_SIZE;
-		aiocbs[i]->aio_lio_opcode = LIO_READ;
-
-		/* Use SIRTMIN+1 for individual completions */
-		aiocbs[i]->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
-		aiocbs[i]->aio_sigevent.sigev_signo = SIGRTMIN+1;
-		aiocbs[i]->aio_sigevent.sigev_value.sival_int = i;
-	}
-
-	/* Use SIGRTMIN+2 for list completion */
-	event.sigev_notify = SIGEV_SIGNAL;
-	event.sigev_signo = SIGRTMIN+2;
-	event.sigev_value.sival_ptr = NULL;
-
-	/* Setup handler for individual operation completion */
-	action.sa_sigaction = sigrt1_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+1, &action, NULL);
-
-	/* Setup handler for list completion */
-	action.sa_sigaction = sigrt2_handler;
-	sigemptyset(&action.sa_mask);
-	action.sa_flags = SA_SIGINFO|SA_RESTART;
-	sigaction(SIGRTMIN+2, &action, NULL);
-
-	/* Setup suspend list */
-	plist[0] = NULL;
-	plist[1] = aiocbs[WAIT_FOR_AIOCB];
-
-	/* Submit request list */
-	ret = lio_listio(LIO_NOWAIT, aiocbs, NUM_AIOCBS, &event);
-
-	if (ret) {
-		printf(TNAME " Error at lio_listio() %d: %s\n", errno, strerror(errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_UNRESOLVED);
-	}
-
-	/* Check selected request has not completed yet */
-	if (received_selected) {
-		printf (TNAME " Error : AIOCB %d already completed before suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Suspend on selected request */
-	ret = aio_suspend((const struct aiocb **)plist, 2, &ts);
-
-	/* Check selected request has not completed */
-	if (received_selected) {
-		printf (TNAME " Error : AIOCB %d should not have completed after timed out suspend\n",
-			WAIT_FOR_AIOCB);
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* timed out aio_suspend should return -1 and set errno to EAGAIN */
-	if (ret != -1) {
-		printf (TNAME " aio_suspend() should return -1\n");
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	if (errno != EAGAIN) {
-		printf (TNAME " aio_suspend() should set errno to EAGAIN: %d (%s)\n",
-			errno, strerror (errno));
-		for (i=0; i<NUM_AIOCBS; i++)
-			free (aiocbs[i]);
-		free (bufs);
-		free (aiocbs);
-		close (fd);
-		exit (PTS_FAIL);
-	}
-
-	/* Wait for list processing completion */
-	while (!received_all)
-		sleep (1);
-
-	/* Check return code and free things */
-	for (i = 0; i < NUM_AIOCBS; i++) {
-	  	err = aio_error(aiocbs[i]);
-		ret = aio_return(aiocbs[i]);
-
-		if ((err != 0) && (ret != BUF_SIZE)) {
-			printf(TNAME " req %d: error = %d - return = %d\n", i, err, ret);
-			errors++;
-		}
-
-		free (aiocbs[i]);
-	}
-
-	free (bufs);
-	free (aiocbs);
-
-	close(fd);
-
-	if (errors != 0)
-		exit (PTS_FAIL);
-
-	printf (TNAME " PASSED\n");
-
-	return PTS_PASS;
-}
-- 
1.7.0.4




------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend.
  2010-11-11  4:02 [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Bian Naimeng
                   ` (3 preceding siblings ...)
  2010-11-11  4:14 ` [LTP] [POSIX][PATCH 4/4]Get rid of aio_suspend/9-1 Bian Naimeng
@ 2010-11-11 10:10 ` Garrett Cooper
  2010-11-11 15:09   ` Cyril Hrubis
  4 siblings, 1 reply; 7+ messages in thread
From: Garrett Cooper @ 2010-11-11 10:10 UTC (permalink / raw)
  To: Bian Naimeng; +Cc: ltp-list

2010/11/10 Bian Naimeng <biannm@cn.fujitsu.com>:
> Some aio_suspend tests are redundantly, so we should remove them.
>
> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>
> ------
>
>  .../conformance/interfaces/aio_suspend/6-1.c       |  217 ------------------
>  .../conformance/interfaces/aio_suspend/7-1.c       |  242 --------------------
>  .../conformance/interfaces/aio_suspend/8-1.c       |  240 -------------------
>  .../conformance/interfaces/aio_suspend/9-1.c       |  242 --------------------
>  4 files changed, 0 insertions(+), 941 deletions(-)

This implies that the tests are broken and need to be fixed (see
assertions.xml for more details about what the tests need to test).

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend.
  2010-11-11 10:10 ` [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Garrett Cooper
@ 2010-11-11 15:09   ` Cyril Hrubis
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2010-11-11 15:09 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

Hi!
> > Some aio_suspend tests are redundantly, so we should remove them.
> >
> > Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
> >
> > ------
> >
> >  .../conformance/interfaces/aio_suspend/6-1.c       |  217 ------------------
> >  .../conformance/interfaces/aio_suspend/7-1.c       |  242 --------------------
> >  .../conformance/interfaces/aio_suspend/8-1.c       |  240 -------------------
> >  .../conformance/interfaces/aio_suspend/9-1.c       |  242 --------------------
> >  4 files changed, 0 insertions(+), 941 deletions(-)
> 
> This implies that the tests are broken and need to be fixed (see
> assertions.xml for more details about what the tests need to test).

Well this is a little more complicated, when looking on the assertions:

4-1.c

On a timeout exit, aio_suspend shall return with an error.

7-1.c

aio_suspend() shall return the value -1 and set errno to indicate error
if it returns before at least one AIO operation have completed.


These test may not be similar, but as the interrupt is generated by
timeout in 7-1.c code for these two tests is similar (except for the
test name).

Sometimes I think that the people writing these test were payed per code
line, so copy & paste was preffered solution.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-11 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11  4:02 [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Bian Naimeng
2010-11-11  4:06 ` [LTP] [POSIX][PATCH 1/4]Get rid of aio_suspend/6-1 Bian Naimeng
2010-11-11  4:07 ` [LTP] [POSIX][PATCH 2/4]Get rid of aio_suspend/7-1 Bian Naimeng
2010-11-11  4:13 ` [LTP] [POSIX][PATCH 3/4]Get rid of aio_suspend/8-1 Bian Naimeng
2010-11-11  4:14 ` [LTP] [POSIX][PATCH 4/4]Get rid of aio_suspend/9-1 Bian Naimeng
2010-11-11 10:10 ` [LTP] [POSIX][PATCH 0/4]Get rid of some test for aio_suspend Garrett Cooper
2010-11-11 15:09   ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox