[PATCH] osmo-mgw[master]: mgcp_test: do not send rtp packets

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Oct 13 18:41:56 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4260

to look at the new patch set (#2).

mgcp_test: do not send rtp packets

The sendto() override in mgcp_test sends rtp packets out. This
might be a problem for some test hosts. e.g. on OBS, sending packets
fails with an error message, which exits sendto() early and hence fails
to send the expected amount of "Dummy Packets". Interestingly enough
calling the real sendto is not necessary to run the test at all.

Remove the execution of the real_sendto and just return len.

Related: OS#2561
Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5
---
M tests/mgcp/mgcp_test.c
1 file changed, 1 insertion(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/60/4260/2

diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 5b292a5..e14b7ee 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -509,15 +509,9 @@
 ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
 	       const struct sockaddr *dest_addr, socklen_t addrlen)
 {
-	typedef ssize_t(*sendto_t) (int, const void *, size_t, int,
-				    const struct sockaddr *, socklen_t);
-	static sendto_t real_sendto = NULL;
 	uint32_t dest_host =
 	    htonl(((struct sockaddr_in *)dest_addr)->sin_addr.s_addr);
 	int dest_port = htons(((struct sockaddr_in *)dest_addr)->sin_port);
-
-	if (!real_sendto)
-		real_sendto = dlsym(RTLD_NEXT, "sendto");
 
 	if (len == 1 && ((const char *)buf)[0] == MGCP_DUMMY_LOAD) {
 		fprintf(stderr,
@@ -526,7 +520,7 @@
 		dummy_packets += 1;
 	}
 
-	return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
+	return len;
 }
 
 static int64_t force_monotonic_time_us = -1;

-- 
To view, visit https://gerrit.osmocom.org/4260
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia8fa0770f9bc75725cc6b0cd445e753f7e029ca5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list