Client was only setting success to false if the function called raised
an exception. This commit changes it to verify the content of return
value with check_state_result
Client was only setting success to false if the function called raised
an exception. This commit changes it to verify the content of return
value with check_state_result
The test suite actually has a ``prod`` env, but this test only considers
the ``base`` env. If a test is run which requests a file (or just the
file/dir/symlink/... list) from the ``prod`` env, then this will result
in the ``prod`` env's file list caches being present, and they will be
removed when the ``fileserver.clear_file_list_cache`` runner is
executed, showing up in the return data and causing the test to fail.
This tweak to the test ensures that we will always have a file list
cache for ``prod`` present, and adjusts the necessary asserts in the
test to expect the ``prod`` env in the return data from the runner.
The tests that return files, symlinks, directories, and empty dirs were
all only testing that the type of the return data was the same as what
was expected. By not testing the content, we overlooked a corner case in
which backends passed into the fileserver as a Python list would not be
handled properly. This has since been fixed in PR #36244, but these
tests will help keep this sort of issue from regressing.
Using a salt.runner.Runner() instance to run this test has exposed a
problem with run_run_plus, where the fileclient doesn't behave as
expected. Since the raw return data is not needed, using run_run here
lets the test pass while we continue to work on run_run_plus.
The return data from run_run_plus previously returned the runner return
in the ``fun`` key. This has since been corrected. This commit replaces
these references to the ``fun`` key with the corrected ``return`` key.
The change in runner output behavior caused the output of test_envs to
change, causing some changes to need to be made in da163471 to get them
to pass. Now that runner output is fixed, the test was returning the
output it should have been in the first place. This commit changes that
test back so that it now expects a list as output.
Additionally, I've taken the opportunity to add additional test calls to
test the "backend" argument for those functions which now have it.