Skip to content
Snippets Groups Projects

Draft: apt-publisher: Add notes about OBS aptly integrations tests

Closed Ariel D'Alessandro requested to merge wip/adalessandro/apt-publisher-aptly-tests into master
@@ -192,3 +192,117 @@ and/or replaced with a different project are therefore very low.
* Automate periodic database cleanups
* Add configuration options for publishing to cloud-based storage
* Implement cloud-based storage options for `aptly`'s internal package pool
# Testing
## Configuration requirements
* Make sure the required environments variables are properly set as follows
(default values are shown here):
```
$ export GNUPGHOME=/srv/obs/gnupg
$ export OBS_FRONTEND_HOST=obs-frontend
```
* Add the following configuration to `/etc/obs/BSConfig.pm`, setting the
`gpg-key` configuration to a valid GPG key:
```
my @reprepro_releases = ("v2022");
my @aptly_releases = ("v2023");
my @apertis_components = ("target", "development", "sdk");
my $apertis_prefix = "shared/apertis/public/apertis";
our $publishedhook_use_regex = 1;
our $publishedhook = {};
our $aptly_defconfig = {
"gpg-key" => "D4B4146191456112D814554C1DB3714017240E34",
};
foreach $release (@reprepro_releases) {
$publishedhook->{"apertis:".$release.":.*"} = "/usr/lib/obs/server/reprepro-snapshot";
};
foreach $release (@aptly_releases) {
$publishedhook->{"apertis:".$release.":.*"} = "/usr/lib/obs/server/bs_published_hook_aptly_snapshot";
};
our $reprepository = {};
foreach $release (@reprepro_releases) {
foreach $component (@apertis_components) {
$reprepository->{"apertis:".$release.":".$component."/default"} = {
"repository" => $apertis_prefix,
"codename" => $release,
"component" => $component
};
$reprepository->{"apertis:".$release.":updates:".$component."/default"} = {
"repository" => $apertis_prefix,
"codename" => $release."-updates",
"component" => $component
};
$reprepository->{"apertis:".$release.":security:".$component."/default"} = {
"repository" => $apertis_prefix,
"codename" => $release."-security",
"component" => $component
};
};
};
our $aptly_config = {};
foreach $release (@aptly_releases) {
foreach $component (@apertis_components) {
$aptly_config->{$apertis_prefix}{$release}{"components"}{$component} = {
"project" => "apertis:".$release.":".$component,
"repository" => "default",
};
$aptly_config->{$apertis_prefix}{$release."-updates"}{"components"}{$component} = {
"project" => "apertis:".$release.":updates:".$component,
"repository" => "default",
};
$aptly_config->{$apertis_prefix}{$release."-security"}{"components"}{$component} = {
"project" => "apertis:".$release.":security:".$component,
"repository" => "default",
};
};
};
1;
```
### OBS aptly integration test
Simple test setting up aptly repositories to validate OBS aptly backend
integration.
* Copy the following test files to a temporary location with write permissions
to the `obsrun` user: `tests/aptly/aptly.sh tests/aptly/common.sh`
* Run the test script, which should show this message on success:
```
$ ./aptly.sh
[...]
PASSED: all tests successfully passed!
```
### Reprepro to aptly migration
This test set a few reprepro repositories on OBS, then migrates them to aptly.
* Copy the following test files to a temporary location with write permissions
to the `obsrun` user: `tests/aptly/common.sh tests/aptly/migration.sh tests/aptly/reprepro.sh`
* Run the tests scripts, which should show these messages on success:
```
$ ./reprepro.sh
[...]
PASSED: all tests successfully passed!
$ ./migration.sh
[...]
PASSED: all tests successfully passed!
```
Loading