From 8cf042b47fc97e9ca54c4f1b7527e5f1a66b9d19 Mon Sep 17 00:00:00 2001 From: Lukas Ruzicka Date: Wed, 31 Jul 2019 15:00:15 +0200 Subject: [PATCH] Add test for yaml files. --- templates | 2 +- tests/modularity_testyaml.pm | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/modularity_testyaml.pm diff --git a/templates b/templates index 3702293e..e704175f 100755 --- a/templates +++ b/templates @@ -4712,7 +4712,7 @@ { name => "modularity_tests", settings => [ - { key => "POSTINSTALL", value => "modularity_module_list modularity_enable_disable_module modularity_install_module modularity_checkdefaults" }, + { key => "POSTINSTALL", value => "modularity_module_list modularity_enable_disable_module modularity_install_module modularity_checkdefaults modularity_testyaml" }, { key => "USER_LOGIN", value => "false" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, { key => "START_AFTER_TEST", value => "install_default_upload" }, diff --git a/tests/modularity_testyaml.pm b/tests/modularity_testyaml.pm new file mode 100644 index 00000000..74a05c98 --- /dev/null +++ b/tests/modularity_testyaml.pm @@ -0,0 +1,23 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +sub run { + my $self=shift; + # switch to tty and login as root + $self->root_console(tty=>3); + + # Install python3-yaml for yaml parsing. + assert_script_run('dnf install -y python3-yaml'); + + # Test if modules have corresponding yaml defaults files and that they are . + assert_script_run('/root/modularity/modular_functions.py -a testyaml -w whitelist'); +} + +sub test_flags { + return {always_rollback => 1}; +} + +1; + +# vim: set sw=4 et: