Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
open-build-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
obs
open-build-service
Commits
448465f9
Unverified
Commit
448465f9
authored
1 month ago
by
Andrej Shadura
Browse files
Options
Downloads
Patches
Plain Diff
tests: Test publisher and aptly integration
parent
33fe5b8b
No related branches found
No related tags found
No related merge requests found
Pipeline
#137655
passed
4 weeks ago
Stage: sanity-check
Stage: docker
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+8
-2
8 additions, 2 deletions
.gitlab-ci.yml
tests/04-test-aptly
+122
-0
122 additions, 0 deletions
tests/04-test-aptly
tests/backend-config/BSConfig.local.pm
+1
-1
1 addition, 1 deletion
tests/backend-config/BSConfig.local.pm
with
131 additions
and
3 deletions
.gitlab-ci.yml
+
8
−
2
View file @
448465f9
...
...
@@ -108,7 +108,7 @@ unit-tests:
tags
:
-
heavyweight
services
:
-
name
:
docker:
stable
-dind
-
name
:
docker:
28
-dind
alias
:
docker
variables
:
DOCKER_DRIVER
:
overlay2
...
...
@@ -134,6 +134,11 @@ unit-tests:
worker:
image: $CI_REGISTRY_IMAGE/worker:$TAG_SHA
volumes:
aptly-storage:
driver_opts:
type: none
o: bind
device: './storage/aptly'
backend-storage:
driver_opts:
type: none
...
...
@@ -169,7 +174,7 @@ unit-tests:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
-
docker info
-
echo "$COMPOSE_OVERLAY" > docker-compose.override.yml
-
mkdir -p logs/backend logs/frontend logs/worker storage/backend
-
mkdir -p logs/backend logs/frontend logs/worker storage/backend
storage/aptly
-
|
cat << EOF > ~/.oscrc
[general]
...
...
@@ -179,6 +184,7 @@ unit-tests:
pass = opensuse
EOF
-
docker-compose up -d
-
docker-compose ps
-
wait-for-it docker:5252 -s --timeout=180 -- echo "The OBS backend is up"
-
wait-for-it docker:80 -s --timeout=180 -- echo "The OBS frontend is up"
-
PATH=$PWD/tests/scripts:$PATH
...
...
This diff is collapsed.
Click to expand it.
tests/04-test-aptly
0 → 100755
+
122
−
0
View file @
448465f9
#!/bin/sh
.
$(
dirname
$0
)
/scripts/common.sh
set
+x
prj_arch
=
"x86_64"
prj_components
=
"target development sdk"
prj_distro
=
"v2030"
prj_osname
=
"apertis"
prj_repo
=
"default"
prj_public_prefix
=
"shared/apertis/public/apertis"
get_prjconf
()
{
prj_distro
=
"
$1
"
cat
<<
EOF
Repotype: debian
type: dsc
release: b
$prj_distro
.0b<B_CNT>
buildengine: debootstrap
EOF
}
get_empty_prjmeta
()
{
cat
<<
EOF
<project name="
$1
">
<title>
$1
repository</title>
</project>
EOF
}
APTLY_API_URL
=
http://aptly:8080
aptlyctl
()
{
echo
+
APTLY_API_URL
=
$APTLY_API_URL
aptlyctl
"
$@
"
docker-compose
--project-directory
"
$OBSDIR
"
exec
-T
-e
APTLY_API_URL
=
$APTLY_API_URL
backend aptlyctl
"
$@
"
}
wait_for_aptly
()
{
iterations
=
5
wait
=
5
echo
"Checking aptly:
$@
"
for
i
in
$(
seq
$iterations
)
do
if
aptlyctl
"
$@
"
then
break
fi
if
[
$i
-eq
$iterations
]
then
return
1
fi
echo
"Sleeping
${
wait
}
s (iteration
$i
/
$iterations
)"
sleep
$wait
done
}
cleanup
()
{
aptlyctl publish drop
--ignore-if-missing
$prj_public_prefix
$prj_distro
for
prj_component
in
$prj_components
do
project
=
"
$prj_osname
:
$prj_distro
:
$prj_component
"
# Newer osc can do osc repo remove
get_empty_prjmeta
$project
| osc meta prj
"
$project
"
-F
-
done
tap_end
}
trap
cleanup EXIT
for
prj_component
in
$prj_components
do
project
=
"
$prj_osname
:
$prj_distro
:
$prj_component
"
create-project
--publish
Debian:
$debian_release
:main/main
"
$project
/
$prj_repo
"
get_prjconf
$prj_distro
| osc meta prjconf
"
$project
"
-F
-
repo
=
"
$project
/
$prj_repo
"
wait_for_aptly repo test-exists
"
$repo
"
tap_ok
$?
"aptly repo for
$prj_component
exists"
done
echo
"Checking aptly distribution publish:
$prj_public_prefix
$prj_distro
"
wait_for_aptly publish test-exists
$prj_public_prefix
$prj_distro
tap_ok
$?
"aptly publish exists"
test_component
=
${
prj_components
%% *
}
pkg_version
=
$(
date
+%+4Y%m%d.%H%M%S
)
cat
>
test-pkg.equivs
<<
EOF
Package: test-pkg
Version:
$pkg_version
Build-Depends: debhelper-compat (= 12)
EOF
bin_files
=
test-pkg
equivs-build
--source
test-pkg.equivs
osc dput
$prj_osname
:
$prj_distro
:
$test_component
test-pkg_
*
.dsc
tap_ok
$?
"upload and create test package"
wait-for-pkg
$prj_osname
:
$prj_distro
:
$test_component
test-pkg
$prj_repo
x86_64
tap_ok
$?
"build test package"
echo
Waiting
for
the package to publish
sleep
5
for
bin_file
in
$bin_files
;
do
echo
"Checking package binary:
$bin_file
"
aptlyctl repo search
--exit-code
"
$prj_osname
:
$prj_distro
:
$test_component
/
$prj_repo
"
"
$bin_file
"
|
grep
"
$pkg_version
"
tap_ok
$?
"binary package
$bin_file
present in aptly repo"
done
echo
DONE
This diff is collapsed.
Click to expand it.
tests/backend-config/BSConfig.local.pm
+
1
−
1
View file @
448465f9
my
@reprepro_releases
=
("
v2022
");
my
@aptly_releases
=
("
v20
2
3
");
my
@aptly_releases
=
("
v203
0
");
my
@apertis_components
=
("
target
",
"
development
",
"
sdk
");
my
$apertis_prefix
=
"
shared/apertis/public/apertis
";
my
$aptly_server
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment