-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In chisel.yaml, archive definitions can now use the "pro" value to specify Ubuntu Pro archives. The `archives.<name>.pro` value currently accepts the following values: "fips", "fips-updates", "esm-apps" and "esm-infra". Any other values are ignored. By default, Chisel will look for credentials in the `/etc/apt/auth.conf.d/` directory, unless the environment variable `CHISEL_AUTH_DIR` is set. In which case, it will look for configuration files in that directory. The configuration files may only have the ".conf" extensions or no extensions, the format is described in https://manpages.debian.org/testing/apt/apt_auth.conf.5.en.html. Co-authored-by: Rafid Bin Mostofa <[email protected]>
- Loading branch information
1 parent
7eb8428
commit 6418c54
Showing
18 changed files
with
938 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Pro Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
schedule: | ||
- cron: "0 0 */2 * *" | ||
workflow_run: | ||
workflows: ["CLA check"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
real-archive-tests: | ||
name: Real Archive Tests | ||
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} | ||
# Do not change to newer releases as "fips" may not be available there. | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Run real archive tests | ||
env: | ||
PRO_TOKEN: ${{ secrets.PRO_TOKEN }} | ||
run: | | ||
set -ex | ||
detach() { | ||
sudo pro detach --assume-yes || true | ||
sudo rm -f /etc/apt/auth.conf.d/90ubuntu-advantage | ||
} | ||
trap detach EXIT | ||
# Attach pro token and enable services | ||
sudo pro attach ${PRO_TOKEN} --no-auto-enable | ||
# Cannot enable fips and fips-updates at the same time. | ||
# Hack: enable fips, copy the credentials and then after enabling | ||
# other services, add the credentials back. | ||
sudo pro enable fips --assume-yes | ||
sudo cp /etc/apt/auth.conf.d/90ubuntu-advantage /etc/apt/auth.conf.d/90ubuntu-advantage.fips-creds | ||
# This will disable the fips service. | ||
sudo pro enable fips-updates esm-apps esm-infra --assume-yes | ||
# Add the fips credentials back. | ||
sudo sh -c 'cat /etc/apt/auth.conf.d/90ubuntu-advantage.fips-creds >> /etc/apt/auth.conf.d/90ubuntu-advantage' | ||
sudo rm /etc/apt/auth.conf.d/90ubuntu-advantage.fips-creds | ||
# Make apt credentials accessible to USER. | ||
sudo setfacl -m u:$USER:r /etc/apt/auth.conf.d/90ubuntu-advantage | ||
# Run tests on Pro real archives. | ||
go test ./internal/archive/ --real-pro-archive | ||
spread-tests: | ||
name: Spread tests | ||
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
repository: snapcore/spread | ||
path: _spread | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.17.0' | ||
|
||
- name: Build and run spread | ||
env: | ||
PRO_TOKEN: ${{ secrets.PRO_TOKEN }} | ||
run: | | ||
(cd _spread/cmd/spread && go build) | ||
_spread/cmd/spread/spread -v tests/pro-archives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.