sysdeploy/tests/maas.sh

42 lines
771 B
Bash
Executable File

#!/bin/bash
function test_stream()
{
local mimetype
get_streams
mimetype="$(file -b --mime-type "$streams")"
assertEquals "$mimetype" "application/json"
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.
. /usr/bin//shunit2