Stephens, Allan wrote:
We are pleased to announce the release an updated version of the
Portable TIPC Test Suite for TIPC 1.7.
and tipc-1.5.12!
Attached is a patch to make ptts work with the vtipc patch.
I've just added a "-s <stack_id> option.
./tipcTS -s 1
./tipcTC -s 1 <test>
// Randy
diff -Naur ptts-1.1-lx/tipc_ts_client.c ptts-1.1-lx-vtipc/tipc_ts_client.c
--- ptts-1.1-lx/tipc_ts_client.c 2007-12-13 12:01:36.000000000 -0500
+++ ptts-1.1-lx-vtipc/tipc_ts_client.c 2007-12-18 00:19:57.000000000 -0500
@@ -1072,11 +1072,14 @@
void tipcTestClient
(
+int stack,
int test /* test number to run (0 = all tests) */
)
{
int lastTestNum; /* the last test to be run */
+ setDefaultSocketStack(stack);
+
if (test == TS_KILL_SERVER) {
printf("Shutting down server\n");
sendTIPCTest(TS_KILL_SERVER);
diff -Naur ptts-1.1-lx/tipc_ts_client_linux.c
ptts-1.1-lx-vtipc/tipc_ts_client_linux.c
--- ptts-1.1-lx/tipc_ts_client_linux.c 2007-12-13 12:01:37.000000000 -0500
+++ ptts-1.1-lx-vtipc/tipc_ts_client_linux.c 2007-12-18 00:25:55.000000000
-0500
@@ -44,6 +44,7 @@
static struct option options[] = {
{"verbose", 0, 0, 'v'},
{"kill", 0, 0, 'k'},
+ {"stack", 1, 0, 's'},
{"help", 0, 0, 'h'},
{0, 0, 0, 0}
};
@@ -52,6 +53,7 @@
"Usage: %s [-v -k] <test>\n"
" -v verbose (repeat to increase detail)\n"
" -k kill servers\n"
+ " -s <id> open sockets on stack <id>\n"
" -h print help\n"
" <test> test number to run (0 => run all tests)\n";
@@ -61,6 +63,7 @@
int c; /* option being processed */
int test = -1; /* test number set to a value we will never get
*/
int killServers = 0; /* flag for killing the server(s) default to
"do not kill" */
+ int stack_id = 0;
verbose = 0; /* default */
@@ -72,6 +75,9 @@
case 'k':
killServers = 1;
break;
+ case 's':
+ stack_id = atoi(optarg);
+ break;
case 'h':
printf(usage, argv[0]);
tipcTestSuiteHelp();
@@ -92,12 +98,12 @@
exit(1);
}
- tipcTestClient(test);
+ tipcTestClient(stack_id, test);
optind++;
}
if (killServers) {
- tipcTestClient(TS_KILL_SERVER);
+ tipcTestClient(stack_id, TS_KILL_SERVER);
}
printf("TIPC test suite finished\n");
diff -Naur ptts-1.1-lx/tipc_ts_common.c ptts-1.1-lx-vtipc/tipc_ts_common.c
--- ptts-1.1-lx/tipc_ts_common.c 2007-12-13 12:01:37.000000000 -0500
+++ ptts-1.1-lx-vtipc/tipc_ts_common.c 2007-12-18 00:24:36.000000000 -0500
@@ -38,8 +38,8 @@
#include "tipc_ts.h" /* must use " for rtp projects */
-
-
+/* Global stack_id used for socket creation. */
+static int stack_id = 0;
/**
* nameList - list of all test names, must be in sync with:
@@ -548,9 +548,18 @@
}
/**
- * createSocketTIPC - create a TIPC socket
+ * setDefaultSocketStack - set global used to indicate
+ * which vTIPC stack to use for calls to createSocketTIPC.
*/
+void setDefaultSocketStack(int stack)
+{
+ stack_id = stack;
+ /* printf("DEBUG: set default stack to %d.\n", stack_id); */
+}
+/**
+ * createSocketTIPC - create a TIPC socket
+ */
int createSocketTIPC
(
int type /* socket type to create
SOCK_STREAM/SOCK_SEQPACKET/SOCK_DGRAM/SOCK_RDM */
@@ -558,7 +567,7 @@
{
int sockfd_N; /* socket created */
- sockfd_N = socket (AF_TIPC, type, 0);
+ sockfd_N = socket (AF_TIPC, type, stack_id);
if (sockfd_N < 0)
failTest ("socket() error");
diff -Naur ptts-1.1-lx/tipc_ts_server.c ptts-1.1-lx-vtipc/tipc_ts_server.c
--- ptts-1.1-lx/tipc_ts_server.c 2007-12-13 12:01:38.000000000 -0500
+++ ptts-1.1-lx-vtipc/tipc_ts_server.c 2007-12-18 00:15:18.000000000 -0500
@@ -1114,7 +1114,7 @@
*
*/
-void tipcTestServer(void)
+void tipcTestServer(int stack)
{
int test; /* this is the test passed from the Test Client process
*/
int testIndex; /* this is the index used to find the actual test we
want to run*/
@@ -1134,6 +1134,8 @@
debug("Starting Server\n");
+ setDefaultSocketStack(stack);
+
setServerAddr (&addr);
msgSize = sizeof(test);
diff -Naur ptts-1.1-lx/tipc_ts_server_linux.c
ptts-1.1-lx-vtipc/tipc_ts_server_linux.c
--- ptts-1.1-lx/tipc_ts_server_linux.c 2007-12-13 12:01:38.000000000 -0500
+++ ptts-1.1-lx-vtipc/tipc_ts_server_linux.c 2007-12-18 00:25:14.000000000
-0500
@@ -42,6 +42,7 @@
int verbose; /* global controlling the no/info/debug (0/1/2) print level
*/
static struct option options[] = {
+ {"stack", 1, 0, 's'},
{"verbose", 0, 0, 'v'},
{0, 0, 0, 0}
};
@@ -49,11 +50,13 @@
char usage[] =
"Usage: %s [-v]\n"
" -v verbose (repeat to increase detail)\n"
+ " -s <stack_id> open socket on specified stack,\n"
" -h print help\n";
int main(int argc, char* argv[], char* dummy[])
{
int c;
+ int stack_id = 0;
verbose = 0; /* default */
@@ -65,13 +68,16 @@
case 'h':
printf(usage, argv[0]);
exit(0);
+ case 's':
+ stack_id = atoi(optarg);
+ break;
default:
printf(usage, argv[0]);
exit(1);
}
}
- tipcTestServer();
+ tipcTestServer(stack_id);
exit(0);
}
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion