Skip to content

tests: add audio-record prompting integration tests - #17015

Merged
olivercalder merged 7 commits into
canonical:masterfrom
olivercalder:prompting-add-audio-record-integration-tests
May 6, 2026
Merged

tests: add audio-record prompting integration tests#17015
olivercalder merged 7 commits into
canonical:masterfrom
olivercalder:prompting-add-audio-record-integration-tests

Conversation

@olivercalder

@olivercalder olivercalder commented May 1, 2026

Copy link
Copy Markdown
Member

Now that snapd and the prompting-client support prompting for audio-record, add apparmor-prompting-integration-tests variants to exercise it end-to-end.

Lifespan "forever" is exercised thoroughly elsewhere, so use lifespan "timespan" to check rule persistence, especially since triggering prompts for audio-record is comparatively simple and quick to check.

Also, since audio-record constraints have no path/path-pattern, there's no way to namespace rules between tests, so we need to ensure they are cleaned between runs.

These are inspired by the audio-record smoke test, since there's no WirePlumber available in spread VMs to trigger a prompt the way it happens in practice (on resolute+).

This relies on the prompting-client shipping this fix: canonical/prompting-client#308

So in the meantime, we may need to switch this spread test to use the latest/edge channel of the prompting-client, and switch back to latest/stable later. We similarly need the latest/edge channel to land #16931, so it's probably worth making this switch in a dedicated PR, then landing these two PRs, then later reverting the one which switched channels.

This work is tracked internally by https://warthogs.atlassian.net/browse/SNAPDENG-36765

unskip:

  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-26.04-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-26.04-64:tests/main/snap-interfaces-requests-control

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds new spread variants to the apparmor-prompting-integration-tests suite to exercise AppArmor prompting end-to-end for the audio-record interface, including installing a helper snap and cleaning up prompting state between runs.

Changes:

  • Add audio-record spread variants and install/connect a prompt-requester helper snap for those variants.
  • Add scripted prompting-client JSON + shell drivers for audio-record single and timespan scenarios.
  • Ensure prompting request/rule state is removed on restore to avoid cross-test interference.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
tests/main/apparmor-prompting-integration-tests/task.yaml Adds new audio-record variants, installs helper snap for those variants, and cleans prompting state on restore.
tests/main/apparmor-prompting-integration-tests/prompt-requester/meta/snap.yaml Defines a helper snap used to create a process/cgroup context for ask requests.
tests/main/apparmor-prompting-integration-tests/prompt-requester/bin/wait-for Helper app that stays running until a “finish” file appears (used to keep a stable PID/cgroup).
tests/main/apparmor-prompting-integration-tests/prompt-requester/bin/cat Simple wrapper around /bin/cat (part of helper snap).
tests/main/apparmor-prompting-integration-tests/audio_record_single.sh Drives ask requests for audio-record and validates outcomes across multiple prompts.
tests/main/apparmor-prompting-integration-tests/audio_record_single.json Scripted prompting-client prompt filters + replies for the single-lifespan flow.
tests/main/apparmor-prompting-integration-tests/audio_record_timespan_allow.sh Drives ask requests and validates allow-timespan then deny after expiry.
tests/main/apparmor-prompting-integration-tests/audio_record_timespan_allow.json Scripted replies for allow-timespan then deny.
tests/main/apparmor-prompting-integration-tests/audio_record_timespan_deny.sh Drives ask requests and validates deny-timespan then allow after expiry.
tests/main/apparmor-prompting-integration-tests/audio_record_timespan_deny.json Scripted replies for deny-timespan then allow.

Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_deny.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/task.yaml Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_deny.json Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_deny.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_allow.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_single.json Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_allow.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_allow.json Outdated
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

Wed May 6 15:08:19 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/25438014555

Failures:

Preparing:

  • openstack:debian-sid-64:tests/regression/mount-order-regression
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/interfaces-gpio-control
  • openstack:ubuntu-core-26-64:tests/core/
  • openstack:ubuntu-core-26-64:tests/core/
  • openstack:ubuntu-core-26-64:tests/main/
  • openstack:ubuntu-core-26-64:tests/main/
  • openstack:ubuntu-24.04-64:tests/main/nss-modules:nis
  • openstack:ubuntu-24.04-64:tests/regression/lp-1618683

Executing:

  • openstack:amazon-linux-2-64:tests/completion/indirect:plain_plusdirs
  • openstack:arch-linux-64:tests/main/services-snapctl
  • openstack:centos-9-64:tests/main/drop-privs
  • openstack:debian-sid-64:tests/unit/go:static
  • openstack:fedora-42-64:tests/main/snap-run-gdbserver:deprecated
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/dbus-activation-system
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/dbus-activation-session
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/basic-target-socket-activation
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/unclash-mount-entries
  • garden:ubuntu-core-18-64:tests/core/gadget-kernel-refs-update-pc
  • openstack:ubuntu-core-22-64:tests/main/cohorts
  • openstack:ubuntu-core-26-64:tests/main/snap-user-service-socket-activation
  • openstack:ubuntu-20.04-64:tests/main/user-mounts
  • openstack:ubuntu-25.10-64:tests/unit/go:clang
  • openstack:ubuntu-24.04-64:tests/main/snap-seccomp-syscalls
  • openstack:ubuntu-16.04-64:tests/completion/indirect:plain
  • openstack:ubuntu-16.04-64:tests/completion/indirect:funky
  • openstack:ubuntu-16.04-64:tests/main/interfaces-browser-support:disallow
  • openstack:ubuntu-16.04-64:tests/completion/indirect:hosts_n_dirs
  • openstack:ubuntu-16.04-64:tests/completion/indirect:hosts

Restoring:

  • openstack:centos-9-64:tests/main/drop-privs
  • openstack:centos-9-64:tests/main/
  • openstack:centos-9-64:
  • openstack:debian-sid-64:tests/regression/mount-order-regression
  • openstack:debian-sid-64:tests/regression/
  • openstack:debian-sid-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:ubuntu-24.04-64:tests/main/nss-modules:winbind
  • openstack:ubuntu-24.04-64:tests/regression/lp-1618683
  • openstack:ubuntu-24.04-64:tests/regression/
  • openstack:ubuntu-24.04-64:
  • openstack:ubuntu-20.04-64:tests/main/user-mounts
  • openstack:ubuntu-20.04-64:tests/main/
  • openstack:ubuntu-20.04-64:

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)

  • garden:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/i18n
  • openstack:centos-9-64:tests/main/selinux-clean
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:fedora-42-64:tests/main/selinux-clean
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-25.10-64:tests/main/interfaces-requests-activates-handlers

@natibek natibek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Just one question.

MATCH '"outcome": "allow"' < "$RESULT"

# Trigger a fourth request
ASK_BODY="{\"action\": \"ask\", \"interface\": \"audio-record\", \"pid\": $WAITER_SNAP_PID}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a concern that this fourth request is triggered close to the 10second duration of the initial response?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think so, these requests should be basically instantaneous.

@natibek natibek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

@olivercalder
olivercalder force-pushed the prompting-add-audio-record-integration-tests branch from 5d71300 to 2dfa5ba Compare May 4, 2026 20:26
@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.13%. Comparing base (89b23a7) to head (9d51f3d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17015      +/-   ##
==========================================
+ Coverage   79.07%   79.13%   +0.05%     
==========================================
  Files        1378     1367      -11     
  Lines      191273   191111     -162     
  Branches     2465     2465              
==========================================
- Hits       151247   151232      -15     
+ Misses      30920    30779     -141     
+ Partials     9106     9100       -6     
Flag Coverage Δ
unittests 79.13% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.

Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_single.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_allow.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/audio_record_timespan_deny.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 12 changed files in this pull request and generated 4 comments.


echo "Run the test script as the test user"
if ! tests.session -u test exec sh -x "${TEST_DIR}/${VARIANT}.sh" "$TEST_DIR" "$TIMEOUT"; then
if ! tests.session -u test exec sh -xe "${TEST_DIR}/${VARIANT}.sh" "$TEST_DIR" "$TIMEOUT"; then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not having -e confused me a lot, so it makes more sense to keep -e and instead specially handle the places in which we expect failures to occur.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 33 changed files in this pull request and generated 6 comments.

Comment thread tests/main/apparmor-prompting-integration-tests/download_file_defaults.sh Outdated
Comment thread tests/main/apparmor-prompting-integration-tests/download_file_safer.sh Outdated

for name in test1.txt test2.txt test3.txt test4.txt ; do
TEST_OUTPUT="$(cat "${WRITABLE}/${name}")"
TEST_OUTPUT="$(cat "${WRITABLE}/${name}" || true)"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's why we check $TEST_OUTPUT on the next line

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 58 out of 61 changed files in this pull request and generated 6 comments.

Comment on lines +18 to +24
for i in $(seq "$TIMEOUT") ; do
if ! pgrep -af "prompting-client.scripted.*${TEST_DIR}" ; then
break
fi
sleep 1
done
if pgrep -af "prompting-client.scripted.*${TEST_DIR}" ; then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was deliberate, if this is hanging I want to see what's running.

Comment on lines 51 to +53
# expect any rules with duplicate path patterns.
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | MATCH '^[[:space:]]*1'
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | NOMATCH '^[[:space:]]*2'
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1'
! snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep -q '^[[:space:]]*[^1[[:space:]]]'
Comment on lines 49 to +52
# Rules with identical path patterns are merged, so we don't expect any rules
# with duplicate path patterns.
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | MATCH '^[[:space:]]*1'
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | NOMATCH '^[[:space:]]*2'
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1'
! snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep -q '^[[:space:]]*[^1[[:space:]]]'
Comment on lines +20 to +24
# Start the snap running in the background so "ask" can use its PID to look up
# its cgroup, and from that derive the snap name.
prompt-requester.wait-for "$TARGET_FILE" &
WAITER_SHELL_PID="$!"

Comment on lines +20 to +24
# Start the snap running in the background so "ask" can use its PID to look up
# its cgroup, and from that derive the snap name.
prompt-requester.wait-for "$TARGET_FILE" &
WAITER_SHELL_PID="$!"

Comment on lines +20 to +24
# Start the snap running in the background so "ask" can use its PID to look up
# its cgroup, and from that derive the snap name.
prompt-requester.wait-for "$TARGET_FILE" &
WAITER_SHELL_PID="$!"

@natibek natibek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Just one issue.

# expect any rules with duplicate path patterns.
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | MATCH '^[[:space:]]*1'
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | NOMATCH '^[[:space:]]*2'
snap debug api /v2/interfaces/requests/rules | jq '."result".[]."constraints"."path-pattern"' | grep "${TEST_DIR}" | uniq -c | grep '^[[:space:]]*1'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this pattern needs to be something like ^[[:space:]]*1[[:space:]]*$ to avoid matching any number starting with the digit 1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Though, this is a bit extreme I realize since we only send the request twice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That was my rationale too... I'll slot in a fix if there are any other things to change, but otherwise I don't think it's necessary. The regex would have to be this I think: ^[[:space:]]*1[[:space:]] since after the number and a space there will be other text.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, that makes sense.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I fixed it

@olivercalder
olivercalder requested a review from natibek May 5, 2026 21:47

@natibek natibek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@andrewphelpsj andrewphelpsj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment on lines +24 to +33
for i in $(seq "$TIMEOUT") ; do
if ! pgrep -af "prompting-client.scripted.*${TEST_DIR}" ; then
break
fi
sleep 1
done
if pgrep -af "prompting-client.scripted.*${TEST_DIR}" ; then
echo "prompting-client.scripted still running"
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You are really doing this construct a lot, maybe worth abstracting one day, but not high priority.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah I had an abstraction via timeout and while loop but then the timeout and while commands were being caught in the pgrep lookup, causing it to never see itself as done. And pgrep -f doesn't work with binary names longer than 15 characters so I gave up and did the most direct thing. If you have ideas though I'm all ears.

@olivercalder olivercalder added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label May 6, 2026
@olivercalder olivercalder added cross-distro Runs all spread systems in parallel labels May 6, 2026
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
@olivercalder
olivercalder force-pushed the prompting-add-audio-record-integration-tests branch from bcf60fb to 9d51f3d Compare May 6, 2026 13:23
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Wed May 6 20:59:20 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/25438014555

Failures:

Preparing:

  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:

Executing:

  • openstack:debian-sid-64:tests/unit/go:static
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny

Restoring:

  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:opensuse-15.6-64:
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-26.04-64:tests/main/
  • openstack:ubuntu-26.04-64:
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-26.04-64:tests/main/
  • openstack:ubuntu-26.04-64:

Skipped tests from snapd-testing-skip

If you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)

  • garden:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack-arm:ubuntu-24.04-arm-64:tests/main/i18n
  • openstack-arm:ubuntu-core-24-arm-64:tests/main/i18n
  • openstack:centos-9-64:tests/main/selinux-clean
  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack:fedora-42-64:tests/main/selinux-clean
  • openstack:ubuntu-24.04-64:tests/main/i18n
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-flag-restart
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:audio_record_timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_actioned_by_other_pid_always_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_multiple_not_actioned_by_other_pid_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_fd_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_chmod_same_path_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:create_write_write_same_path_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_conflict
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_defaults
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:download_file_safer
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:read_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:special_characters
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:timespan_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_allow_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_read_multiple_actioned_by_other_pid_deny_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_allow
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-integration-tests:write_single_deny
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-prompt-restoration
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:audiorecord_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:camera_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_allow_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_forever
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_session
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_single
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-smoke:home_deny_timespan
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-snapd-startup
  • openstack:ubuntu-25.10-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-25.10-64:tests/main/interfaces-requests-activates-handlers
  • openstack:ubuntu-26.04-64:tests/main/apparmor-prompting-support
  • openstack:ubuntu-26.04-64:tests/main/i18n

@olivercalder
olivercalder merged commit 7dade7a into canonical:master May 6, 2026
405 of 440 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system cross-distro Runs all spread systems in parallel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants