New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Remove keylime.conf #1133
base: master
Are you sure you want to change the base?
Conversation
This also updates the configuration description. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Also update the options names used on the examples. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
I need to fix the test scripts to generate the configuration files. Leaving this as a draft for now. |
installer.sh
Outdated
@@ -409,7 +409,7 @@ echo "========================================================================== | |||
mkdir -p /etc/keylime | |||
mkdir -p config | |||
pushd scripts | |||
python3 convert_config.py --input ../keylime.conf --out ../config | |||
python3 convert_config.py --input /dev/null --out ../config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using /dev/null
as input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to provide an empty input to:
- use the default values for all options
- not use the system installed configuration files. If no input is provided, the
convert_config.py
script will try to use the system installed configuration.
I think I can modify the script to accept a new option to used default values for all options instead of using this workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use --input
as optional, and it will default to None
. This can signal what you want, and the cli will be clear: python3 convert_config --out ../config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default behavior when no input is provided is to use the system installed configuration files as input to generate upgraded config without changing the user set options. This is already implemented.
What I want is to use the default values for the options ignoring any eventual system installed files. The workaround was to provide an empty file as input (so that it wouldn't search for the system installed files). But it is kind of ugly.
I decided to add a separate option --defaults
to make the script to ignore any input.
e405ca1
to
af36199
Compare
When the '--defaults' option is provided, the script will ignore input files and the system installed files and will use the default value for all options. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
The split configuration files can be generated without any input by using the default values for all options. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
The resulting elements after the manual splitting of a list were not correctly stripped to remove leading/trailing white spaces. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Some of the default values in the mappings would result in a configuration not functional out of the box. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Install keylime using the installer.sh script instead of moving only the old configuration file. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Use the default values for all options. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
af36199
to
6d74a33
Compare
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Use a virtual environment for the python components and temporary directories for the generated files. The dependencies are still installed in the system. The used configuration files are generated in a temporary directory with the changes necessary to run the tests. The installed configuration files are not modified. The files generated when running run_tests.sh will be removed at the end of the execution unless the environment variable KEEP_TMP_FILES=1. If the tests are executed using the run_tests.sh script, all the necessary dependencies are installed and environment variables set. When running test_restful.py outside run_tests.sh with RUST_TEST=1, it expects the KEYLIME_RUST_AGENT and KEYLIME_RUST_CONF environment variables set, respectively, with the path to the rust agent binary and the rust agent configuration file. If the environment variables are not set, it tries to find the rust agent binary and configuration in an adjacent directory (i.e. in the same location run_tests.sh downloads it). Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Only somewhat related: I think we should move the |
I think this is a good idea, to move this script and install along the others. In future the script relevance will only grow. Another change that we should consider is to have the configuration mappings/templates which are currently in |
To get rid of some of the test failures you may want to rebase on master. |
@ansasaki what is the state of this PR now that othe config PR was merged? |
I'll get back to this, but I can't promise that it will be very soon. Hopefully I will get back to this and finish before 7.0.0, but I don't consider it a release blocker. |
@ansasaki do you have the time to complete this or should I pick up this PR? I think the changes to the converter script are already in the master branch, so it should be just fixing the merge conflict issues and seeing if we not missed something. |
@@ -93,7 +93,7 @@ def adjust(config, mapping): | |||
v = value.strip("[]").split(",") | |||
|
|||
# Eliminate surrounding blank space from each element | |||
map(lambda x: x.strip(), v) | |||
v = map(lambda x: x.strip(), v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unnecessary to assign it to v.
Remove all mentions to the old configuration file keylime.conf.