test/cases: rename json sections

Rename to fit more closely with their use before we add too many more
of these.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-12-08 15:03:50 +01:00 committed by Lars Karlitski
parent 6c44d231ee
commit cc04f92997
16 changed files with 20 additions and 20 deletions

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "qemu-extract"
},
"compose": {
@ -129,7 +129,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -114,7 +114,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "nspawn"
},
"compose": {

View file

@ -96,7 +96,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "nspawn"
},
"compose": {

View file

@ -1,6 +1,6 @@
{
"url": "https://download.fedoraproject.org/pub/fedora/linux/releases/30/Cloud/x86_64/images/Fedora-Cloud-Base-30-1.2.x86_64.qcow2",
"expected": {
"image-info": {
"bootloader": "grub",
"bootmenu": [
{

View file

@ -118,7 +118,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "qemu"
},
"compose": {

View file

@ -119,7 +119,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "qemu"
},
"compose": {

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "nspawn-extract"
},
"compose": {

View file

@ -117,7 +117,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "qemu"
},
"compose": {

View file

@ -115,7 +115,7 @@
}
}
},
"expected": {
"image-info": {
"boot-environment": {
"GRUB2_BOOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",
"GRUB2_ROOT_FS_UUID": "76a22bf4-f153-4541-b6c7-0332c0dfaeac",

View file

@ -1,5 +1,5 @@
{
"boot-test": {
"boot": {
"type": "qemu"
},
"compose": {

View file

@ -188,8 +188,8 @@ def run_test(case, store):
subprocess.run(["xz", "--decompress", "--stdout", filename], stdout=f)
filename = fn
info = json.loads(subprocess.check_output(["tools/image-info", filename]))
if info != case["expected"]:
with temporary_json_file(case["expected"]) as a, temporary_json_file(info) as b:
if info != case["image-info"]:
with temporary_json_file(case["image-info"]) as a, temporary_json_file(info) as b:
subprocess.run(["diff", "--unified", "--color", "--label", "expected", a, "--label", "got", b], check=False)
return False
except KeyError:
@ -202,11 +202,11 @@ def get_local_boot_test_case(fname: str) -> Union[Tuple[str, str, Dict[Any, Any]
with open(fname, "r") as fd:
test_case_dict = json.load(fd)
if "boot-test" not in test_case_dict:
if "boot" not in test_case_dict:
return None
pipeline_dict = test_case_dict["pipeline"]
return test_case_dict["boot-test"]["type"], test_case_dict["compose"]["filename"], pipeline_dict
return test_case_dict["boot"]["type"], test_case_dict["compose"]["filename"], pipeline_dict
def run_ssh_test(private_key):