From 22cc382f9e9aa38f3adad18acd426bf0292bbf00 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 10 Nov 2021 10:34:05 +0200 Subject: feat: check that virtual network names are syntactically correct Sponsored-by: author --- vmadm.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'vmadm.md') diff --git a/vmadm.md b/vmadm.md index 6d0491a..85df349 100644 --- a/vmadm.md +++ b/vmadm.md @@ -346,6 +346,66 @@ foo: - bridge=br1 ~~~ +# Check that network name is OK + +vmadm must check that the virtual network name is OK. The scenarios +in this chapter verify that for the configuration and spec files. + +## Check network name in config + +~~~scenario +given an installed vmadm +given a Debian 10 OpenStack cloud image +given file .config/vmadm/config.yaml from bad-network-config.yaml +given file ca_key +given file .ssh/id_rsa from ssh_key +given file .ssh/id_rsa.pub from ssh_key_pub +given file .ssh/config from ssh_config +given file .ssh/known_hosts from known_hosts +when I try to run vmadm config +then command fails +then stderr contains ": br0" +~~~ + +~~~{#bad-network-config.yaml .file .yaml} +image_directory: ~/images +default_base_image: ~/base.qcow2 +default_image_gib: 5 +default_memory_mib: 2048 +default_cpus: 1 +default_generate_host_certificate: true +default_autostart: true +ca_key: ~/ca_key +authorized_keys: + - ~/.ssh/id_rsa.pub +default_networks: +- br0 +~~~ + +## Check network name in spec + +~~~scenario +given an installed vmadm +given a Debian 10 OpenStack cloud image +given file .config/vmadm/config.yaml from config.yaml +given file ca_key +given file .ssh/id_rsa from ssh_key +given file .ssh/id_rsa.pub from ssh_key_pub +given file .ssh/config from ssh_config +given file .ssh/known_hosts from known_hosts +given file bad-network-spec.yaml +when I try to run vmadm spec bad-network-spec.yaml +then command fails +then stderr contains ": br0" +~~~ + +~~~{#bad-network-spec.yaml .file .yaml} +foo: + networks: + - br0 +~~~ + + # Colophon This is a document meant to be processed with [Subplot][] into an HTML -- cgit v1.2.1