sysdeploy/tests/maas.sh
Peter Surda c14ed9eb77
fix: magic
- also swap assert description for stream download test
2021-02-26 21:43:48 +01:00

42 lines
771 B
Bash
Executable File

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