luet/tests/integration/08_versioning.sh

87 lines
2.2 KiB
Bash
Raw Normal View History

2020-03-29 08:54:11 +00:00
#!/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
2020-03-29 08:54:11 +00:00
buildst=$?
assertEquals 'builds successfully' "0" "$buildst"
luet build --tree "$ROOT_DIR/tests/fixtures/versioning" --destination $tmpdir/testbuild --compression gzip media-libs/libsndfile
buildst=$?
assertEquals 'builds successfully' "0" "$buildst"
2020-11-29 11:02:46 +00:00
luet build --tree "$ROOT_DIR/tests/fixtures/versioning" --destination $tmpdir/testbuild --compression gzip '=dev-libs/libsigc++-2-2.10.1+1'
buildst=$?
assertEquals 'builds successfully' "0" "$buildst"
2020-03-29 08:54:11 +00:00
}
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' "0" "$createst"
2020-03-29 08:54:11 +00:00
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"
config_from_host: true
2020-03-29 08:54:11 +00:00
repositories:
- name: "main"
type: "disk"
enable: true
urls:
- "$tmpdir/testbuild"
EOF
luet config --config $tmpdir/luet.yaml
res=$?
assertEquals 'config test successfully' "0" "$res"
}
2020-03-29 08:54:11 +00:00
testInstall() {
2020-11-22 19:16:04 +00:00
luet install -y --config $tmpdir/luet.yaml media-libs/libsndfile
2020-03-29 08:54:11 +00:00
installst=$?
assertEquals 'install test successfully' "0" "$installst"
2020-03-29 08:54:11 +00:00
}
testInstall2() {
2020-11-29 11:02:46 +00:00
luet install -y --config $tmpdir/luet.yaml '=dev-libs/libsigc++-2-2.10.1+1'
2020-03-29 08:54:11 +00:00
installst=$?
assertEquals 'install test successfully' "0" "$installst"
2020-03-29 08:54:11 +00:00
}
testCleanup() {
luet cleanup --config $tmpdir/luet.yaml
installst=$?
assertEquals 'install test successfully' "0" "$installst"
2020-03-29 08:54:11 +00:00
}
# Load shUnit2.
. "$ROOT_DIR/tests/integration/shunit2"/shunit2