Skip to content

Adding topology hiding no dlg tests for new one way hiding and compac…#32

Open
davidtrihy-genesys wants to merge 4 commits into
OpenSIPS:mainfrom
davidtrihy-genesys:topology_hiding_no_dlg_tests
Open

Adding topology hiding no dlg tests for new one way hiding and compac…#32
davidtrihy-genesys wants to merge 4 commits into
OpenSIPS:mainfrom
davidtrihy-genesys:topology_hiding_no_dlg_tests

Conversation

@davidtrihy-genesys

@davidtrihy-genesys davidtrihy-genesys commented Jun 8, 2026

Copy link
Copy Markdown

Tests for this feature OpenSIPS/opensips#3908

I added AI generated scenario details in each test directory to give an easier understanding of what the scenario is asserting, we can remove that commit before merging or keep it.

@liviuchircu liviuchircu self-assigned this Jun 12, 2026
@liviuchircu

Copy link
Copy Markdown
Member

Some setup-related issues before things started working on my end:

Bad mpath

-mpath = "/usr/local/lib64/opensips/modules/"
+mpath = "/usr/lib/x86_64-linux-gnu/opensips/modules/"

This was necessary in order to match the standard mpath found in SIPssert's existing "opensips.cfg" test files and in the image builds. This way, the same image can be used to run all tests.

NOTE: Unrelated segfault in topology-hiding-no-dlg-legacy/15.

This is how I run legacy test 15., with a local-built OpenSIPS image after merging PR #3908:

sudo sipssert topology-hiding-no-dlg-legacy -t topology-hiding-no-dlg-legacy/15.no-contact-in-reply -E opensips_image=opensips-local:topo-hiding

... and perhaps it crashes 1/5 times, in what looks to be a shutdown crash:

(gdb) bt
#0  0x00007c1c066a043c in __memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:184
#1  0x00007c1c05653968 in ?? ()
#2  0x00007c1c05617010 in ?? ()
#3  0x0000033e05654000 in ?? ()
#4  0x00006039d08366ff in thread_free_dbg (ptr=0x7c1bf8000b60, file=0x6039d09d44c2 "net/net_tcp.c", function=0x6039d09d8e30 <__FUNCTION__.46> "tcp_conn_destroy_req", line=807) at mem/thread_mem.c:54
#5  0x00006039d08d802c in tcp_conn_destroy_req (c=0x7c1c03a43218) at net/net_tcp.c:807
#6  0x00006039d08d84a6 in __tcpconn_rm (c=0x7c1c03a43218, no_event=1) at net/net_tcp.c:841
#7  0x00006039d08dcd78 in __tcpconn_lifetime (shutdown=1) at net/net_tcp.c:1945
#8  0x00006039d08de29b in tcp_destroy () at net/net_tcp.c:2164
#9  0x00006039d07a26da in cleanup (show_status=1) at shutdown.c:63
#10 0x00006039d07a3ad1 in shutdown_opensips (status=0) at shutdown.c:240
#11 0x00006039d07a3d02 in handle_sigs () at signals.c:70
#12 0x00006039d07232e6 in main_loop () at main.c:356
#13 0x00006039d072607d in main (argc=2, argv=0x7ffd4eb357e8) at main.c:887

Just curious if you ever got this one -- we will look into it separately, it looks to be TCP related. Anyway, I spent some time today getting the SIPssert corefile generation working properly while running the tests, fixed ulimit issues, directories, mounts, permissions, etc. before the cores started being preserved after the container is destroyed. I will push the corefile preservation patch to upstream sipssert once I test it a bit more.

Apart from this, all legacy tests are passing on my end as well, at a first glance. More feedback to come, of course, on the actual SIP signaling. And finally, on the topology-hiding-no-dlg/ tests too:

$ sudo sipssert topology-hiding-no-dlg-legacy -E opensips_image=opensips-local:topo-hiding
======= Running SIPssert Testing Framework =======
 Running test set: topology-hiding-no-dlg-legacy =
01.no-record-routes...........................PASS
02.external-record-routes-only................PASS
03.internal-record-routes-mixed...............PASS
04.multiple-uris-mixed-record-routes..........PASS
05.multiple-uris-one-record-route.............PASS
06.single-uri-per-record-route................PASS
07.two-way-hiding-req-record-routes...........PASS
08.two-way-hiding-mixed-record-routes.........PASS
09.two-way-hiding-reply-record-routes.........PASS
10.internal-socket-tag-match..................PASS
11.internal-socket-tag-mismatch...............PASS
12.contact-has-no-port........................PASS
13.contact-invalid-thinfo.....................PASS
14.contact-wrong-thinfo-param-name............PASS
15.no-contact-in-reply........................PASS
16.no-contact-in-reply-with-internal-recor....FAIL
17.internal-record-routes-only-uac-interna....PASS
18.internal-record-routes-mixed-uac-intern....PASS
19.single-uri-per-record-route-uac-interna....PASS
Summary: Total     Passed    Failed    
         19        18        1    

@davidtrihy-genesys

Copy link
Copy Markdown
Author

We use a different module path so yeah sorry about that, before I commit any changes I'll change it to the default one, we're actually using jinja templating and we are forking sipssert to add new functionality and push it back upstream if we think it's valuable so we'll probably explicitly add that soon so these scripts come from a jinja template so I could template in a module path with the default in it.

The 19 tests you ran are a subset of the other suite which has two additional tests, I'm actually going to add a new one based on one of the bugs from the main PR I fixed around checking buffer bounds.

One additional thing is I AI generated some scenario markdown files which explain the scenario and they're actually decently descriptive, I can remove them or leave them, entirely up to you, just added them in the PR for you to be able to read them and get an understanding of the tests and what explicitly I am testing.

@davidtrihy-genesys

Copy link
Copy Markdown
Author

@liviuchircu I added a new suite that does some validation of malicious input it is test 22 in the non legacy suite, I couldn't get the csv values working correctly with sipssert so I just unrolled the suite into a single xml file and it runs 14 different transactions verifying different assumptions, these are based off the feedback in the PR around the buffer boundary checking when decoding, the thinfo is precomputed with the default password, would be nice to make it dynamic moving forward, in fact I think adding support to the management interface to execute the decoding logic would be cool moving forward but for now I think just hardcoding is fine to verify. So let me know what you think of the tests and whether to keep the scenario.md files and we can move forward from that.

Forgot to answer that question about the crash I have not seen that crash happen to me which is quite strange.

@davidtrihy-genesys davidtrihy-genesys force-pushed the topology_hiding_no_dlg_tests branch from 1629cc7 to ead120e Compare June 15, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants