[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Mon Dec 23 07:23:45 MST 2013


The branch, master has been updated
       via  b448961 test: Fix getsockopt on Solaris.
       via  1544ad6 tests: Fix getsockopt() on Solaris.
       via  3c4759a tests: writev/readv must have iovec > 0
       via  450f4f3 tests: Remove unused variable warning
      from  b7f7ed3 torture: Add TORTURE_SKIP_CLEANUP to not delete socket_dir.

http://gitweb.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b44896165f3265b702e667550bbb6d4e1ec09b43
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Dec 23 15:23:21 2013 +0100

    test: Fix getsockopt on Solaris.

commit 1544ad632c71e2fe9d355baf639f2a9a0d479b0d
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Dec 23 15:03:26 2013 +0100

    tests: Fix getsockopt() on Solaris.

commit 3c4759afc44b73484e99b130e931b2779b1f956c
Author: Jakub Hrozek <jakub.hrozek at gmail.com>
Date:   Mon Dec 23 15:37:06 2013 +0100

    tests: writev/readv must have iovec > 0
    
    writev/readv with iovec == 0 works on Linux, but that is not portable.

commit 450f4f31c5afe4516a5db5fc071aa012dfb64202
Author: Jakub Hrozek <jakub.hrozek at gmail.com>
Date:   Mon Dec 23 14:57:14 2013 +0100

    tests: Remove unused variable warning
    
    The variables were unused if SIOCGPGRP wasn't defined.

-----------------------------------------------------------------------

Summary of changes:
 tests/test_echo_tcp_socket_options.c |    9 +++++----
 tests/test_echo_tcp_writev_readv.c   |    4 ++--
 tests/test_ioctl.c                   |    2 ++
 3 files changed, 9 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tests/test_echo_tcp_socket_options.c b/tests/test_echo_tcp_socket_options.c
index 798d612..8ec631f 100644
--- a/tests/test_echo_tcp_socket_options.c
+++ b/tests/test_echo_tcp_socket_options.c
@@ -42,9 +42,9 @@ static void test_sockopt_sndbuf(void **state)
 	struct sockaddr_in sin;
 	socklen_t slen = sizeof(struct sockaddr_in);
 	int obufsize = 0;
-	socklen_t olen = 0;
+	socklen_t olen = sizeof(obufsize);
 	int gbufsize = 0;
-	socklen_t glen = 0;
+	socklen_t glen = sizeof(gbufsize);
 	int sbufsize = 0;
 	int rc;
 	int s;
@@ -69,14 +69,15 @@ static void test_sockopt_sndbuf(void **state)
 	rc = getsockopt(s, SOL_SOCKET, SO_SNDBUF, &obufsize, &olen);
 	assert_int_equal(rc, 0);
 
-	sbufsize = ((obufsize + 1023) & (~1023));
+	/* request 4k, on Linux the kernel doubles the value */
+	sbufsize = 4096;
 	rc = setsockopt(s, SOL_SOCKET, SO_SNDBUF, &sbufsize, sizeof(sbufsize));
 	assert_int_equal(rc, 0);
 
 	rc = getsockopt(s, SOL_SOCKET, SO_SNDBUF, &gbufsize, &glen);
 	assert_int_equal(rc, 0);
 
-	assert_int_equal(gbufsize, sbufsize);
+	assert_true(sbufsize == gbufsize || sbufsize == gbufsize/2);
 
 	close(s);
 }
diff --git a/tests/test_echo_tcp_writev_readv.c b/tests/test_echo_tcp_writev_readv.c
index 0aa1ae2..9f6703f 100644
--- a/tests/test_echo_tcp_writev_readv.c
+++ b/tests/test_echo_tcp_writev_readv.c
@@ -59,7 +59,7 @@ static void test_writev_readv_ipv4(void **state)
 	rc = connect(s, (struct sockaddr *)&sin, slen);
 	assert_int_equal(rc, 0);
 
-	for (i = 0; i < 10; i++) {
+	for (i = 1; i < 10; i++) {
 		char send_buf[10][64];
 		char recv_buf[10][64];
 		struct iovec iov_send[10];
@@ -123,7 +123,7 @@ static void test_writev_readv_ipv6(void **state)
 	rc = connect(s, (struct sockaddr *)&sin6, slen);
 	assert_int_equal(rc, 0);
 
-	for (i = 0; i < 10; i++) {
+	for (i = 1; i < 10; i++) {
 		char send_buf[10][64];
 		char recv_buf[10][64];
 		struct iovec iov_send[10];
diff --git a/tests/test_ioctl.c b/tests/test_ioctl.c
index 0c9bfc6..d365641 100644
--- a/tests/test_ioctl.c
+++ b/tests/test_ioctl.c
@@ -69,8 +69,10 @@ static void test_swrap_socket(void **state)
 static void test_swrap_ioctl_sock(void **state)
 {
 	int fd;
+#ifdef SIOCGPGRP
 	int rc;
 	int grp = -127;
+#endif
 
 	(void) state; /* unused */
 


-- 
Socket Wrapper Repository


More information about the samba-cvs mailing list