Skip to Content.
Sympa Menu

ndt-dev - [ndt] r329 committed - bringing in trunk changes...

Subject: NDT-DEV email list created

List archive

[ndt] r329 committed - bringing in trunk changes...


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt] r329 committed - bringing in trunk changes...
  • Date: Thu, 25 Mar 2010 17:21:09 +0000

Revision: 329
Author: jwzurawski
Date: Thu Mar 25 10:15:32 2010
Log: bringing in trunk changes

-jason


http://code.google.com/p/ndt/source/detail?r=329

Added:
/branches/jz-localization/contrib/ndt_log_delete.pl
Modified:
/branches/jz-localization
/branches/jz-localization/src/testoptions.c
/branches/jz-localization/src/web100srv.c

=======================================
--- /dev/null
+++ /branches/jz-localization/contrib/ndt_log_delete.pl Thu Mar 25 10:15:32 2010
@@ -0,0 +1,77 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+=head1 NAME
+
+ndt_log_delete.pl
+
+=head1 DESCRIPTION
+
+Given a 'safe date' from an external application, delete
+the log directories for an NDT server.
+
+=cut
+
+my $hostname = shift or die "Please provide hostname.\n";
+
+open( READ, "/home/iupui_ndt/./get_safe_delete_date.py rsync://ndt.iupui." . $hostname . ":7999/ndt-data
+|" );
+my @date = <READ>;
+close( READ );
+
+die "Date not found from 'get_safe_delete_date.py', aborting.\n" unless $date[0];
+$date[0] =~ s/-//g;
+
+my $dir = "/usr/local/ndt/serverdata";
+
+dirwalk($dir);
+
+exit(1);
+
+sub dirwalk {
+ my $dirname = shift;
+
+ opendir ( DIR, $dirname ) or die "Error in opening dir $dirname\n";
+ my @dir = readdir(DIR);
+ closedir(DIR);
+ foreach my $filename ( sort @dir ) {
+ next if $filename eq ".." or $filename eq ".";
+ next unless -d $dirname . "/" . $filename;
+
+ dirwalk( $dirname . "/" . $filename );
+ my $comp = substr( $dirname."/".$filename, length( $dir ) );
+ $comp =~ s/\///g;
+ if ( length $comp == 8 and $comp < $date[0] ) {
+# print "rm -frd " . $dirname . "/" . $filename . "\n";
+ system( "rm -frd " . $dirname . "/" . $filename );
+ }
+ }
+ return;
+}
+
+__END__
+
+=head1 VERSION
+
+$Id$
+
+=head1 AUTHOR
+
+Jason Zurawski,

+
+=head1 LICENSE
+
+You should have received a copy of the Internet2 Intellectual Property Framework
+along with this software. If not, see
+<http://www.internet2.edu/membership/ip.html>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2010, Internet2
+
+All rights reserved.
+
+=cut
+
=======================================
--- /branches/jz-localization/src/testoptions.c Tue Mar 23 08:18:56 2010
+++ /branches/jz-localization/src/testoptions.c Thu Mar 25 10:15:32 2010
@@ -527,25 +527,32 @@
*/
log_println(1, "listening for Inet connection on testOptions->c2ssockfd, fd=%d", testOptions->c2ssockfd);

- log_println(1, "Sending 'GO' signal, to tell client to head for the next test");
+ log_println(1, "Sending 'GO' signal, to tell client %d to head for the next test", testOptions->child0);
sprintf(buff, "%d", testOptions->c2ssockport);
send_msg(ctlsockfd, TEST_PREPARE, buff, strlen(buff));

clilen = sizeof(cli_addr);
- j = 0;
- for (;;) {
- if ((recvsfd = accept(testOptions->c2ssockfd, (struct sockaddr *) &cli_addr, &clilen)) > 0)
+ /* j = 0; */
+ log_println(6, "child %d - sent c2s prepare to client", testOptions->child0);
+ for (j=0; j<5; j++) {
+ recvsfd = accept(testOptions->c2ssockfd, (struct sockaddr *) &cli_addr, &clilen);
+ if (recvsfd > 0) {
+ log_println(6, "accept() for %d completed", testOptions->child0);
break;
-
- if ((recvsfd == -1) && (errno == EINTR))
+ }
+ if ((recvsfd == -1) && (errno == EINTR)) {
+ log_println(6, "Child %d interrupted while waiting for accept() to complete",
+ testOptions->child0);
continue;
-
- sprintf(tmpstr, "------- S2C connection setup returned because (%d)", errno);
- if (get_debuglvl() > 1)
- perror(tmpstr);
- if (++j == 4)
+ }
+ log_println(6, "------- C2S connection setup for %d returned because (%d)",
+ testOptions->child0, errno);
+ if (++j == 4) {
+ log_println(6, "c2s child %d, uable to open connection, return from test", testOptions->child0);
return -2;
- }
+ }
+ }
+ log_println(6, "child %d - c2s ready for test with fd=%d", testOptions->child0, recvsfd);
src_addr = I2AddrByLocalSockFD(get_errhandle(), recvsfd, 0);
conn = web100_connection_from_socket(agent, recvsfd);

@@ -555,7 +562,8 @@
close(ctlsockfd);
close(testOptions->c2ssockfd);
close(recvsfd);
- log_println(5, "C2S test Child thinks pipe() returned fd0=%d, fd1=%d", mon_pipe1[0], mon_pipe1[1]);
+ log_println(5, "C2S test Child %d thinks pipe() returned fd0=%d, fd1=%d",
+ testOptions->child0,mon_pipe1[0], mon_pipe1[1]);
/* log_println(2, "C2S test calling init_pkttrace() with pd=0x%x", (int) &cli_addr); */
init_pkttrace(src_addr, (struct sockaddr *) &cli_addr, clilen, mon_pipe1,
device, &pair, "c2s", options->compress);
@@ -724,7 +732,7 @@
web100_log_close_write(snapArgs.log);
}

- sprintf(buff, "%6.0f kbps outbound", *c2sspd);
+ sprintf(buff, "%6.0f kbps outbound for child %d", *c2sspd, testOptions->child0);
log_println(1, "%s", buff);
/* send the c2sspd to the client */
sprintf(buff, "%0.0f", *c2sspd);
@@ -913,7 +921,7 @@
}
testOptions->s2csockfd = I2AddrFD(s2csrv_addr);
testOptions->s2csockport = I2AddrPort(s2csrv_addr);
- log_println(1, " -- port: %d", testOptions->s2csockport);
+ log_println(1, " -- s2c %d port: %d", testOptions->child0, testOptions->s2csockport);
pair.port1 = -1;
pair.port2 = testOptions->s2csockport;

@@ -939,7 +947,11 @@

/* Data received from speed-chk, tell applet to start next test */
sprintf(buff, "%d", testOptions->s2csockport);
- send_msg(ctlsockfd, TEST_PREPARE, buff, strlen(buff));
+ j = send_msg(ctlsockfd, TEST_PREPARE, buff, strlen(buff));
+ if (j == -1)
+ log_println(6, "S2C %d Error!, Test start message not sent!", testOptions->child0);
+ if (j == -2)
+ log_println(6, "S2C %d Error!, server port [%s] not sent!", testOptions->child0, buff);

/* ok, await for connect on 3rd port
* This is the second throughput test, with data streaming from
@@ -950,9 +962,11 @@
j = 0;
clilen = sizeof(cli_addr);
for (;;) {
- if ((xmitsfd = accept(testOptions->s2csockfd, (struct sockaddr *) &cli_addr, &clilen)) > 0)
+ xmitsfd = accept(testOptions->s2csockfd, (struct sockaddr *) &cli_addr, &clilen);
+ if (xmitsfd > 0) {
+ log_println(6, "S2C %d, has sfd=%d, read to stream data", testOptions->child0, xmitsfd);
break;
-
+ }
if ((xmitsfd == -1) && (errno == EINTR))
continue;

@@ -966,6 +980,7 @@
conn = web100_connection_from_socket(agent, xmitsfd);

if (xmitsfd > 0) {
+ log_println(6, "S2C child %d, ready to fork()", testOptions->child0);
if (getuid() == 0) {
pipe(mon_pipe2);
if ((mon_pid2 = fork()) == 0) {
@@ -1123,6 +1138,7 @@
t = secs();
s = t + 10.0;

+ log_println(6, "S2C child %d begining test", testOptions->child0);
while(secs() < s) {
c3++;
if (options->avoidSndBlockUp) {
@@ -1155,6 +1171,7 @@
sigaction(SIGALRM, &old, NULL);
sndqueue = sndq_len(xmitsfd);

+ log_println(6, "S2C child %d finished test", testOptions->child0);
shutdown(xmitsfd, SHUT_WR); /* end of write's */

s = secs() - t;
=======================================
--- /branches/jz-localization/src/web100srv.c Tue Mar 23 08:18:56 2010
+++ /branches/jz-localization/src/web100srv.c Thu Mar 25 10:15:32 2010
@@ -1334,7 +1334,7 @@

opterr = 0;
while ((c = getopt_long(argc, argv,
- GETOPT_LONG_INET6(GETOPT_LONG_EXP("adhmoqrstvzc:b:f:i:l:p:T:A:S:")), long_options, 0)) != -1) {
+ GETOPT_LONG_INET6(GETOPT_LONG_EXP("adhmoqrstvzc:x:b:f:i:l:p:T:A:S:")), long_options, 0)) != -1) {
switch (c) {
case 'c':
ConfigFileName = optarg;
@@ -1363,7 +1363,7 @@
debug = 0;

while ((c = getopt_long(argc, argv,
- GETOPT_LONG_INET6(GETOPT_LONG_EXP("adhmoqrstvzc:b:f:i:l:p:T:A:S:")), long_options, 0)) != -1) {
+ GETOPT_LONG_INET6(GETOPT_LONG_EXP("adhmoqrstvzc:x:b:f:i:l:p:T:A:S:")), long_options, 0)) != -1) {
switch (c) {
case '4':
conn_options |= OPT_IPV4_ONLY;


  • [ndt] r329 committed - bringing in trunk changes..., ndt, 03/25/2010

Archive powered by MHonArc 2.6.16.

Top of Page