Skip to content

Fix tests that fail against current Asterisk master - #162

Merged
github-actions[bot] merged 8 commits into
asterisk:masterfrom
WyoMurf:master-fix-failing-tests
Oct 29, 2026
Merged

github-actions[bot] merged 8 commits into
asterisk:masterfrom
WyoMurf:master-fix-failing-tests

Conversation

@WyoMurf

@WyoMurf WyoMurf commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

These tests fail on an unmodified build of current Asterisk master (and,
for most, 22 and 23) because the tests have fallen behind changes in
Asterisk, not because of bugs in Asterisk. Each commit stands on its own
and fixes one cause:

  • bridge: Drop the automon feature from test configurations. automon
    went away with app_monitor. Asterisk rejects the featuremap section of
    these features.conf files and falls back to the default feature codes,
    so the bridge tests using them fail.
  • masquerade: Dial the parked call with a PJSIP dial string.
    PJSIP/ast1/701 (chan_sip form) is rejected as an invalid URI, so the
    parked call was never retrieved and the test always failed.
  • tests: Declare the raw socket dependency of tests that play pcap
    audio.
    Four tests use play_pcap_audio without the rawsocket
    dependency that the other such tests declare, so they fail instead of
    being skipped when not run as root.
  • hep: Expect a maxptime of 140 in the SDP Asterisk sends. ulaw and
    alaw have a 140 ms maximum since "codec_builtin: Use multiples of 20 for
    maximum_ms" (2023).
  • bridge/simple_bridge: Use automixmon to keep the call off native
    RTP.
    The w/W Dial options no longer add a DTMF hook now that
    automon is gone, so the call was natively bridged instead of using
    simple_bridge.
  • cdr, dial_parallel: Replace the removed NoCDR application. NoCDR()
    was removed in 2022. cdr/cdr_manipulation/nocdr failed. The five
    dial_parallel tests that use it passed only because their echo
    channel hung up at the missing application; the CDR it left behind was
    added to their expectations in 2024. With Set(CDR_PROP(disable)=1)
    (the same flag NoCDR set) the dialplan works as intended and the tests
    expect the two CDRs of the Dial() again.
  • cdr/console_dial_sip_transfer: Redirect to a SIP URI. chan_pjsip
    can't redirect to a bare extension (Transfer(3)), so the call was
    never redirected.
  • masquerade: Raise the open file limit for the Local channel chain.
    The chain of 200 Local channels needs more than the common default soft
    limit of 1024 open files.

Testing

Each changed test, plus all of tests/bridge and tests/apps/dial/dial_parallel,
was run before and after the change against unmodified Asterisk master
(57e2743cc5) on AlmaLinux 10, with the default soft open-file limit of
1024, as a normal user. Before: the tests named above fail. After: they
pass, except that the four raw socket tests are skipped. Run as root,
those four pass, except t38_enabled_two_reinvite_on_a_leg, which still
fails as it did before this change.

Other failures found, not fixed here

These also fail on unmodified master, but the tests are right:

  • sorcery/memory_cache_expire and memory_cache_expire_object: Asterisk
    crashes at startup when a sorcery memory cache has no options
    (endpoint/cache=memory_cache). sorcery_memory_cache_open() calls
    ast_strdupa() on a NULL data since Asterisk commit c8ce2c705, a 2023
    memory leak fix.
  • manager/config/* (4 tests): the AMI config file restrictions compare
    the realpath() of the file with the unresolved astetcdir. Under the
    testsuite the config directory is reached through the /tmp/ast_test_*
    symlink, so every file looks restricted ("File requires escalated
    privileges"). Anyone whose config directory path includes a symlink
    would see the same.

Environment-only failures, for reference: the IAX2 encrypted-calls/rsa
tests fail where the system crypto policy forbids SHA-1 signatures (the
RHEL/AlmaLinux 9+ default), and the raw socket tests fail when not run as
root.

AI use

This change was prepared with an AI coding assistant (Claude Code),
working in my environment at my direction. It ran and compared the tests,
traced each failure to its cause in the Asterisk history, and wrote the
edits and commit messages. I reviewed each change and the test results.

🤖 Generated with Claude Code

WyoMurf and others added 8 commits October 18, 2026 09:15
The automon feature went away with app_monitor.  Asterisk now rejects
the featuremap section of these features.conf files ("Could not find
option suitable for category 'featuremap' named 'automon'") and falls
back to the default feature codes, so the bridge tests that use them
fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test retrieved the parked call by originating PJSIP/ast1/701, the
chan_sip form.  PJSIP takes what follows the endpoint as a SIP URI and
rejects "701", so the parked call was never retrieved and the test
always failed.  Use PJSIP/701@ast1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These tests have SIPp play RTP from pcap files (play_pcap_audio), which
needs a raw socket.  Run as a normal user, SIPp fails with "Can't create
raw IPv4 socket (need to run as root?)" and the tests fail.  Other
tests that play pcap audio declare the rawsocket custom dependency, so
they are skipped instead.  Declare it in these four as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since "codec_builtin: Use multiples of 20 for maximum_ms" (2023) the
maximum packetization time of ulaw and alaw is 140 ms, not 150, so
Asterisk offers a=maxptime:140 and the HEP tests failed to match the
200 OK they capture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test expects the simple_bridge technology, which it got because the
w and W Dial options gave both channels the automon DTMF feature, and
native RTP bridging is not used for channels with DTMF hooks.  automon
went away with app_monitor, so w and W no longer add a hook, the call
is natively bridged, and the test failed.  Use x and X (automixmon),
which the bridge features.conf still maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NoCDR() was removed in 2022 in favor of Set(CDR_PROP(disable)=1), which
sets the same flag.  Since then:

* cdr/cdr_manipulation/nocdr failed: the channel hung up at the missing
  application without disabling its CDR, so an extra CDR was written.

* The five dial_parallel tests that run NoCDR() in their echo extension
  passed for the wrong reason.  The echo channel hung up immediately
  instead of running Echo(), and the CDR it left behind was added to
  their expectations in 2024 as a third CDR.  With its CDR disabled
  again, as the dialplan intends, the tests expect the two CDRs of the
  Dial() to bob and charlie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Transfer(3) redirected to extension 3 under chan_sip.  chan_pjsip takes
the destination as an endpoint name or a SIP URI, so it failed with
"Failed to parse destination URI '3'", the call was never redirected,
and the CDRs for extension 3 were missing.  Redirect to sip:3@127.0.0.1,
which the dialing side follows to Local/3@default as the test expects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chain of 200 Local channels needs more than the common default soft
limit of 1024 open files.  When Asterisk runs out, alert pipes fail with
"Too many open files", channels in the chain hang up early, and the
test fails.  Raise the soft limit, which the Asterisk instances inherit,
to 8192 or the hard limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WyoMurf

WyoMurf commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

multiple-commits: standalone

@WyoMurf

WyoMurf commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

cherry-pick-to: 22
cherry-pick-to: 23
cherry-pick-to: 24

@sangoma-oss-cla

sangoma-oss-cla Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Checklist Complete

@github-actions

Copy link
Copy Markdown

Workflow Check completed successfully

@WyoMurf

WyoMurf commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

The "#56" in the description referred to an asterisk/asterisk PR (the 2023 res_sorcery_memory_cache memory leak fix), not to an issue in this repository. I've reworded the description to cite that commit (c8ce2c705) instead. This PR doesn't resolve any issue.

@gtjoseph

Copy link
Copy Markdown
Member

pr-checklist-exception: commit-msg

@gtjoseph
gtjoseph dismissed github-actions[bot]’s stale review October 19, 2026 13:06

Pull Request Checklist Complete

@gtjoseph

Copy link
Copy Markdown
Member

@WyoMurf FYI... 20 is still an active branch and the commits seem to apply without issue so I've added it to the cherry-picks.

@WyoMurf

WyoMurf commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@gtjoseph Thanks. One caution for 20: the first commit ("bridge: Drop the automon feature from test configurations") removes automon => 4 from configs/bridge/ast1/features.conf. Asterisk 20 still has app_monitor, and the 20 branch of the testsuite still has tests/bridge/automon and tests/bridge/automon_bridgefeatures, which use that mapping. So that commit would break those two tests on 20. The other commits look fine there: 20 already has the 140 ms maxptime, CDR_PROP(disable) sets the same flag as NoCDR, and chan_pjsip handles the redirect target the same way. If the cherry-pick can't leave that one commit out, it may be better to drop 20.

@gtjoseph

Copy link
Copy Markdown
Member

Ah, yeah that'd be a problem. I'll remove 20. Actually, it goes "security-fix-only" this month anyway.

@github-actions github-actions Bot added cherry-pick-testing-in-progress Cherry-Pick tests in progress cherry-pick-checks-passed Cherry-Pick checks passed and removed cherry-pick-test cherry-pick-testing-in-progress Cherry-Pick tests in progress labels Oct 28, 2026
@github-actions

Copy link
Copy Markdown

Workflow CPCheck completed successfully

@github-actions
github-actions Bot merged commit f094733 into asterisk:master Oct 29, 2026
28 checks passed
@github-actions

Copy link
Copy Markdown

Successfully merged to branch master and cherry-picked to ["22","23","24"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants