sysdeploy/tests/maas.sh

49 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
function test_stream()
{
local mimetype
get_streams
mimetype="$(file -b --mime-type "$streams")"
2021-02-26 22:10:58 +01:00
[ "$(lsb_release -cs)" == "bionic" ] && startSkipping
assertEquals "application/json" "$mimetype"
2021-02-26 22:10:58 +01:00
isSkipping && endSkipping
[ "$(lsb_release -cs)" == "focal" ] && startSkipping
assertEquals "text/plain" "$mimetype"
isSkipping && endSkipping
jq . "$streams" &> /dev/null
assertEquals 0 "$?"
cleanup_temp
}
function test_latest_maas_id()
{
get_latest_maas_id
assertEquals "20210223" "$release_version"
}
function test_checksum()
{
get_checksum 20210223 manifest
assertEquals "cf395299f1337f6ea69a86f70d76fb89b8a41274bbbe7047af43614a867a4af2" "$checksum"
}
#function test_download()
#{
# download_and_verify https://images.maas.io/ephemeral-v3/stable/${OS_CODENAME}/amd64/${id}/squashfs
# assertEquals "$?" 0
#}
function oneTimeSetUp()
{
. maas-images.inc
}
function setUp()
{
export streams=tests/data/streams.json
}
# Load shUnit2.
2021-02-26 22:10:58 +01:00
. /usr/bin/shunit2