From 7f4d230d770ece72c9a6a3965bb13c2c0567edb1 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Tue, 14 Feb 2023 19:14:27 +0000 Subject: [PATCH] Fix Tests, update readme and remove hound --- .hound.yml | 15 --------------- README.md | 12 ++++++------ test/functional/api/v2/configs_controller_test.rb | 2 +- test/unit/output_generator_test.rb | 3 ++- 4 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 .hound.yml diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index a4d071cd..00000000 --- a/.hound.yml +++ /dev/null @@ -1,15 +0,0 @@ -scss: - enabled: false - -ruby: - config_file: .rubocop.yml - -jshint: - enabled: false - -eslint: - enabled: true - config_file: .eslintrc - ignore_file: .eslintignore - -fail_on_violations: true diff --git a/README.md b/README.md index 0649a313..cdb475d8 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# ForemanVirtWhoConfigure +# Foreman Virt Who Configure -A foreman plugin to make virt-who configuration easier. This provides simple UI for obtaining required information about the desired virt-who configuration, such as hypervisor credentials, check interval and similar. After the information is gathered, it provides a configuration script that can be used to install and configure the virt-who instance. All incoming reports from such virt-who instance are tracked and monitored by the plugin. +A Foreman plugin to make virt-who configuration easier. This provides a simple UI for obtaining required information about the desired virt-who configuration, such as hypervisor credentials, check interval and other similar config options. After the information is gathered, it provides a configuration script that can be used to install and configure the virt-who instance. All incoming reports from such virt-who instance are tracked and monitored by the plugin. ## Installation -This plugins requires Katello to be installed in your Foreman instance. If its there, simply install a package with the plugin (rpm only), run migrations and seed by running, +This plugins requires Katello to be installed in your Foreman instance. If it's there, simply install a package with the plugin (rpm only), run migrations and seed by running, -yum install rubygem-foreman_virt_who_configure +dnf install rubygem-foreman_virt_who_configure foreman-rake db:migrate foreman-rake db:seed @@ -14,7 +14,7 @@ foreman-rake db:seed After installation there is new "Virt-who configurations" menu added in "Infrastructure" tab. The "Virt-who configurations" -> "Create Config" provides options to add details about configuration, most of the fields are having inline help. -The virt-who configuration should be in an organization. If organization has not selected then Owner field would be displayed where it is required to select organization. If organization is already selected then Owner field is not displayed and virt-configuration will be automatically created in selected organization scope. +The virt-who configuration should be in an organization. If an organization has not selected then Owner field would be displayed where it is required to select organization. If organization is already selected then Owner field is not displayed and virt-configuration will be automatically created in selected organization scope. To deploy the configuration click on configuration name on "Virt-who configurations" list page, "Overview" page shows details about configuration and "Deploy page" has all details on deploying configuration. @@ -26,7 +26,7 @@ Fork and send a Pull Request. Thanks! ## Copyright -Copyright (c) 2017 - Foreman team +Copyright (c) 2023 - Foreman team This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/test/functional/api/v2/configs_controller_test.rb b/test/functional/api/v2/configs_controller_test.rb index dbdfdb55..d2a82d15 100644 --- a/test/functional/api/v2/configs_controller_test.rb +++ b/test/functional/api/v2/configs_controller_test.rb @@ -171,7 +171,7 @@ class ForemanVirtWhoConfigure::Api::V2::ConfigsControllerTest < ActionController post :create, :params => { :foreman_virt_who_configure_config => { :name => 'my new config', :interval => 240, :filtering_mode => ForemanVirtWhoConfigure::Config::BLACKLIST, - :blacklist => ' a,b ', + :blacklist => 'a,b', :hypervisor_id => 'uuid', :hypervisor_type => 'esx', :hypervisor_server => "vmware.example.com", diff --git a/test/unit/output_generator_test.rb b/test/unit/output_generator_test.rb index 06a8b87a..fdfc2a13 100644 --- a/test/unit/output_generator_test.rb +++ b/test/unit/output_generator_test.rb @@ -10,7 +10,8 @@ class OutputGeneratorTest < ActiveSupport::TestCase test 'empty password is replaced by fake value so that virt-who runs in an non-interactive mode' do config.hypervisor_password = nil config.hypervisor_type = 'libvirt' - assert_includes output, 'virt-who-password --password \'' + OutputGenerator::LIBVIRT_FAKE_PASSWORD + '\'' + # (echo bGlidmlydF9mYWtlX3Bhc3N3b3Jk|base64 -d) = OutputGenerator::LIBVIRT_FAKE_PASSWORD + assert_includes output, 'virt-who-password --password $(echo bGlidmlydF9mYWtlX3Bhc3N3b3Jk|base64 -d)' end end