Skip to content

Add screen-private-ppa test (New)#2288

Open
bnbhat wants to merge 1 commit intomainfrom
bnbhat/private-ppa-check
Open

Add screen-private-ppa test (New)#2288
bnbhat wants to merge 1 commit intomainfrom
bnbhat/private-ppa-check

Conversation

@bnbhat
Copy link
Contributor

@bnbhat bnbhat commented Jan 15, 2026

WARNING: This modifies com.canonical.certification::sru-server

Description

This test is to avoid any leak of private PPA credentials in the release image.
This checks if any private PPAs are present in the system, fails if present.

adds miscellanea/screen-private-ppa test to base

This is same as #2212, but I want to the test in base provider instead.

Resolved issues

Resolves: https://warthogs.atlassian.net/browse/PECA-1148

Documentation

Tests

Tested on Qualcomm RB3Gen2 Lite, should work on any system.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.69%. Comparing base (4ace22e) to head (e05bdec).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2288      +/-   ##
==========================================
+ Coverage   54.49%   54.69%   +0.19%     
==========================================
  Files         409      411       +2     
  Lines       43970    44305     +335     
  Branches     8100     8175      +75     
==========================================
+ Hits        23961    24232     +271     
- Misses      19190    19246      +56     
- Partials      819      827       +8     
Flag Coverage Δ
checkbox-ng 71.60% <ø> (ø)
checkbox-support 67.89% <ø> (ø)
provider-base 32.38% <ø> (+0.96%) ⬆️
provider-certification-client 57.14% <ø> (ø)
provider-certification-server 57.14% <ø> (ø)
provider-genio 96.90% <ø> (ø)
provider-gpgpu 93.14% <ø> (ø)
provider-iiotg 100.00% <ø> (ø)
provider-resource 39.57% <ø> (ø)
provider-sru 97.97% <ø> (ø)

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.

@bnbhat bnbhat changed the title Add screen-private-ppa test Add screen-private-ppa test (New) Jan 15, 2026
@bnbhat bnbhat requested review from Hook25 and pseudocc January 21, 2026 15:01
@bnbhat bnbhat requested a review from binli February 2, 2026 14:33
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

Thanks for this. Please see the following:

Comment on lines 576 to 580
if grep -qrE 'private-ppa\.launchpad(|content)\.net' "/etc/apt/sources.list"* ; then
>&2 printf 'The following files have private PPA access:\n'
>&2 grep -lrE 'private-ppa\.launchpad(|content)\.net' "/etc/apt/sources.list"*
exit 1
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is incomprehensible to all non-bash masters. Please either make it easier to read or rewire it in python.
I need to easily be able to tell:

  • What are the matchers (I wouldn't use the regex here, split this into 2 checks, tbh just matching private-ppa should be enough)
  • What happens if that file doesn't exist
  • What is that this is supposed to print when it finds something funny
  • This doesn't read sources.list.d or am I mistaken? If I am mistaken, please make this clear

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, minor concern but there is not much of a difference between writing to std out or stderr, why did you redirect to stderr? it makes the line slightly harder to read and afaik that syntax is a bashism

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review:)

  1. Now it is 2 checks. If I think of it again, I could've just checked for private-ppa instead
  2. prints "No private PPAs found in sources list files" and returns 0
  3. Prints the name of the file that has private-ppa in it and returns 1
  4. Reads both. Now I have added a an extra line to make it clear:)

miscellanea/ubuntu-desktop-recommends certification-status=blocker
miscellanea/ubuntu-desktop-minimal-recommends certification-status=blocker
miscellanea/grub_file_check certification-status=blocker
miscellanea/screen-private-ppa
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can't add this test here, this testplan is ran everywhere and will cause a lot of issues to all test plans that nest this. Please add it to your own testplan only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed:)

This test check if any private PPAs are present in the system,
fails if present. This is to avoid any leak of private PPA tokens
in the release image.
@bnbhat bnbhat force-pushed the bnbhat/private-ppa-check branch from 6ff6c91 to e05bdec Compare February 10, 2026 01:26
@bnbhat bnbhat requested a review from Hook25 February 10, 2026 01:34
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