mirror of
https://github.com/mudler/luet.git
synced 2025-09-18 16:32:16 +00:00
Add versioning integration test
This commit is contained in:
3
tests/fixtures/versioning/libsigc++-2/build.yaml
vendored
Normal file
3
tests/fixtures/versioning/libsigc++-2/build.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
unpack: true
|
||||
image: "alpine"
|
8
tests/fixtures/versioning/libsigc++-2/definition.yaml
vendored
Normal file
8
tests/fixtures/versioning/libsigc++-2/definition.yaml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
Labels: null
|
||||
category: dev-libs
|
||||
conflicts: null
|
||||
id: 0
|
||||
license: LGPL-2.1+
|
||||
name: libsigc++-2
|
||||
version: "+1"
|
3
tests/fixtures/versioning/libsndfile/build.yaml
vendored
Normal file
3
tests/fixtures/versioning/libsndfile/build.yaml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
unpack: true
|
||||
image: "alpine"
|
6
tests/fixtures/versioning/libsndfile/definition.yaml
vendored
Normal file
6
tests/fixtures/versioning/libsndfile/definition.yaml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
category: media-libs
|
||||
conflicts: null
|
||||
id: 0
|
||||
license: LGPL-2.1
|
||||
name: libsndfile
|
||||
version: 1.0.29+pre2_p20191024.1
|
81
tests/integration/08_versioning.sh
Executable file
81
tests/integration/08_versioning.sh
Executable file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LUET_NOLOCK=true
|
||||
|
||||
oneTimeSetUp() {
|
||||
export tmpdir="$(mktemp -d)"
|
||||
}
|
||||
|
||||
oneTimeTearDown() {
|
||||
rm -rf "$tmpdir"
|
||||
}
|
||||
|
||||
testBuild() {
|
||||
mkdir $tmpdir/testbuild
|
||||
luet build --tree "$ROOT_DIR/tests/fixtures/versioning" --destination $tmpdir/testbuild --compression gzip --all > /dev/null
|
||||
buildst=$?
|
||||
assertEquals 'builds successfully' "$buildst" "0"
|
||||
}
|
||||
|
||||
testRepo() {
|
||||
assertTrue 'no repository' "[ ! -e '$tmpdir/testbuild/repository.yaml' ]"
|
||||
luet create-repo --tree "$ROOT_DIR/tests/fixtures/versioning" \
|
||||
--output $tmpdir/testbuild \
|
||||
--packages $tmpdir/testbuild \
|
||||
--name "test" \
|
||||
--descr "Test Repo" \
|
||||
--urls $tmpdir/testrootfs \
|
||||
--type disk > /dev/null
|
||||
|
||||
createst=$?
|
||||
assertEquals 'create repo successfully' "$createst" "0"
|
||||
assertTrue 'create repository' "[ -e '$tmpdir/testbuild/repository.yaml' ]"
|
||||
}
|
||||
|
||||
testConfig() {
|
||||
mkdir $tmpdir/testrootfs
|
||||
cat <<EOF > $tmpdir/luet.yaml
|
||||
general:
|
||||
debug: true
|
||||
system:
|
||||
rootfs: $tmpdir/testrootfs
|
||||
database_path: "/"
|
||||
database_engine: "boltdb"
|
||||
repositories:
|
||||
- name: "main"
|
||||
type: "disk"
|
||||
enable: true
|
||||
urls:
|
||||
- "$tmpdir/testbuild"
|
||||
EOF
|
||||
luet config --config $tmpdir/luet.yaml
|
||||
res=$?
|
||||
assertEquals 'config test successfully' "$res" "0"
|
||||
}
|
||||
|
||||
testInstall() {
|
||||
luet install --config $tmpdir/luet.yaml media-libs/libsndfile
|
||||
#luet install --config $tmpdir/luet.yaml test/c-1.0 > /dev/null
|
||||
installst=$?
|
||||
assertEquals 'install test successfully' "$installst" "0"
|
||||
assertTrue 'package installed' "[ -e '$tmpdir/testrootfs/bin/busybox' ]"
|
||||
}
|
||||
|
||||
testInstall2() {
|
||||
luet install --config $tmpdir/luet.yaml dev-libs/libsigc++-2
|
||||
#luet install --config $tmpdir/luet.yaml test/c-1.0 > /dev/null
|
||||
installst=$?
|
||||
assertEquals 'install test successfully' "$installst" "0"
|
||||
assertTrue 'package installed' "[ -e '$tmpdir/testrootfs/bin/busybox' ]"
|
||||
}
|
||||
|
||||
|
||||
testCleanup() {
|
||||
luet cleanup --config $tmpdir/luet.yaml
|
||||
installst=$?
|
||||
assertEquals 'install test successfully' "$installst" "0"
|
||||
}
|
||||
|
||||
# Load shUnit2.
|
||||
. "$ROOT_DIR/tests/integration/shunit2"/shunit2
|
||||
|
Reference in New Issue
Block a user