forked from canonical/operator-libs-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: fully refactor and expand deb822 unit tests
- Loading branch information
1 parent
da057f5
commit 08aa90d
Showing
15 changed files
with
468 additions
and
320 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
4 changes: 4 additions & 0 deletions
4
tests/unit/data/individual-files/bad-stanza-components-missing-without-exact-path.sources
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,4 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: noble noble-updates noble-backports | ||
# this is an error, must have at least one component if suites isn't an exact path |
4 changes: 4 additions & 0 deletions
4
tests/unit/data/individual-files/bad-stanza-components-present-with-exact-path.sources
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,4 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: an/exact/path/ | ||
Components: main # this is an error, can't have components with an exact path |
5 changes: 5 additions & 0 deletions
5
tests/unit/data/individual-files/bad-stanza-enabled-bad.sources
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,5 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: noble noble-updates noble-backports | ||
Components: main restricted universe multiverse | ||
Enabled: bad |
3 changes: 3 additions & 0 deletions
3
tests/unit/data/individual-files/bad-stanza-missing-required-keys.sources
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,3 @@ | ||
# a comment | ||
|
||
Foo: Bar # this is a separate (malformed) entry |
9 changes: 9 additions & 0 deletions
9
tests/unit/data/individual-files/good-stanza-comments.sources
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,9 @@ | ||
Components: main restricted universe multiverse # Components first! I don't think deb822 cares about ordering | ||
Types: deb deb-src # this could be one or both of these options | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ http://archive.ubuntu.com/ubuntu/ | ||
# there can be multiple space separated URIs | ||
# sources are specified in priority order | ||
# apt does some de-duplication of sources after parsing too | ||
#Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg | ||
# let's make this insecure! (jk, just testing parsing) | ||
Suites: noble noble-updates noble-backports |
5 changes: 5 additions & 0 deletions
5
tests/unit/data/individual-files/good-stanza-enabled-no.sources
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,5 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: noble noble-updates noble-backports | ||
Components: main restricted universe multiverse | ||
Enabled: no |
3 changes: 3 additions & 0 deletions
3
tests/unit/data/individual-files/good-stanza-exact-path.sources
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,3 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: an/exact/path/ |
5 changes: 5 additions & 0 deletions
5
tests/unit/data/individual-files/good-stanza-noble-main-etc.sources
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,5 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: noble noble-updates noble-backports | ||
Components: main restricted universe multiverse | ||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg |
5 changes: 5 additions & 0 deletions
5
tests/unit/data/individual-files/good-stanza-noble-security.sources
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,5 @@ | ||
Types: deb | ||
URIs: http://security.ubuntu.com/ubuntu | ||
Suites: noble-security | ||
Components: main restricted universe multiverse | ||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg |
34 changes: 34 additions & 0 deletions
34
tests/unit/data/individual-files/good-stanza-with-gpg-key.sources
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,34 @@ | ||
Types: deb | ||
URIs: https://ppa.launchpadcontent.net/inkscape.dev/stable/ubuntu/ | ||
Suites: noble | ||
Components: main | ||
Signed-By: | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
. | ||
mQINBGY0ViQBEACsQsdIRXzyEkk38x2oDt1yQ/Kt3dsiDKJFNLbs/xiDHrgIW6cU | ||
1wZB0pfb3lCyG3/ZH5uvR0arCSHJvCvkdCFTqqkZndSA+/pXreCSLeP8CNawf/RM | ||
3cNbdJlE8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MkHFxFkr9n0E4wJhRGgL0OxDWugJemkUvHbzXFNUaeX5Spw/aO7r1CtTh8lyqiom | ||
4ebAkURjESRFOFzcsM7nyQnmt2OgQkEShSL3NrDMkj1+3+FgQtd8sbeVpmpGBq87 | ||
J3iq0YMsUysWq8DJSz4RnBTfeGlJWJkl3XxB9VbG3BqqbN9fRp+ccgZ51g5/DEA/ | ||
q8jYS7Ur5bAlSoeA4M3SvKSlQM8+aT35dteFzejvo1N+2n0E0KoymuRsDBdzby0z | ||
lJDKe244L5D6UPJo9YTmtE4kG/fGNZ5/JdRA+pbe7f/z84HVcJ3ziGdF/Nio/D8k | ||
uFjZP2M/mxC7j+WnmKAruqmY+5vkAEqUPTobsloDjT3B+z0rzWk8FG/G5KFccsBO | ||
2ekz6IVTXVA= | ||
=VF33 | ||
-----END PGP PUBLIC KEY BLOCK----- |
13 changes: 13 additions & 0 deletions
13
tests/unit/data/individual-files/stanzas-fully-commented-out.sources
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,13 @@ | ||
#a fully commented out stanza | ||
#Types: deb # with an inline comment too | ||
#URIs: http://security.ubuntu.com/ubuntu | ||
#Suites: noble-security | ||
#Components: main restricted universe multiverse | ||
#Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg | ||
|
||
#another fully commented out stanza | ||
#Types: deb-src # with an inline comment too | ||
#URIs: http://security.ubuntu.com/ubuntu | ||
#Suites: noble-security | ||
#Components: main restricted universe multiverse | ||
#Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg |
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,11 @@ | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: noble noble-updates noble-backports | ||
Components: main restricted universe multiverse | ||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg | ||
|
||
Types: deb | ||
URIs: http://security.ubuntu.com/ubuntu | ||
Suites: noble-security | ||
Components: main restricted universe multiverse | ||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg |
15 changes: 15 additions & 0 deletions
15
tests/unit/data/individual-files/stanzas-one-good-one-bad-comments.sources
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,15 @@ | ||
# a good entry that defines one repository | ||
Types: deb | ||
URIs: http://nz.archive.ubuntu.com/ubuntu/ | ||
Suites: noble | ||
Components: main | ||
|
||
Foo: Bar # this is a separate (malformed) entry | ||
|
||
# this is fully commented out and will be skipped entirely | ||
#Types: deb | ||
#URIs: http://security.ubuntu.com/ubuntu | ||
#Suites: noble-security | ||
#Components: main restricted universe multiverse | ||
#Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg | ||
## disable security updates while we're at it |
Oops, something went wrong.