rlFile{Backup,Restore} handling nonexistent files
by Jiri Jaburek
Hi,
I'd like to propose a patch series implementing backup of nonexistent
paths. The use case for this is a scenario where a user wants to use
a certain path (ie. a config file) for custom content and doesn't want
to deal with anything that might (or might not) have existed there.
rlFileBackup --clean --ignoremissing /etc/sssd/sssd.conf
echo "$sssd_conf_contents" > /etc/sssd/sssd.conf
...
# rlService* here, testing of the functionality
...
rlFileRestore
The user doesn't need to check if sssd.conf was originally there and
perform rlFileBackup selectively, storing a "config_existed=1" variable
to selectively call rlFileRestore.
I have several safety considerations with --clean implementation within
rlFileBackup, but the behavior after applying this patch series is
really almost indifferent from the current upstream state, even though
it might not seem like it.
Please see more descriptive commit messages in each patch.
Also note that the patch series is just a proof-of-concept, without
documentation, without tests, with only a very basic testing done, with
possibly controversial changes, ..., so please don't pull it into
upstream just yet.
This proposal is more about the idea and rough implementation ways,
rather than solving all problems and catching all corner cases.
Thanks,
Jiri
10 years, 4 months
[PATCH] testwatcher: protect against invalid EWD_SECS value
by Jiri Jaburek
Signed-off-by: Jiri Jaburek <jjaburek(a)redhat.com>
---
src/python/testwatcher.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/python/testwatcher.py b/src/python/testwatcher.py
index aa7b452..8d716c7 100755
--- a/src/python/testwatcher.py
+++ b/src/python/testwatcher.py
@@ -69,6 +69,8 @@ import tempfile
# (25 minutes = 1500 secs by default, configurable via env)
if 'TESTWATCHER_EWD_SECS' in os.environ:
ewd_maxsecs = int(os.environ['TESTWATCHER_EWD_SECS'])
+ if ewd_maxsecs <= 0:
+ raise Exception("invalid TESTWATCHER_EWD_SECS env var value")
else:
ewd_maxsecs = 1500
--
1.8.3.1
10 years, 4 months
[PATCH v3 0/7] Process synchronisation routines
by Hubert Kario
Hi all,
More or less final version, full functionality together with
test suite.
I haven't tested on RHEL 3 as the test harness doesn't work:
./test.sh: line 82: conditional binary operator expected
./test.sh: line 82: syntax error near `=~'
./test.sh: line 82: ` if [[ "$status" =~ ^$expected$ ]]; then'
RHEL 4 and RHEL5 (!) isn't much better:
File "/root/beakerlib/src/test/../python/journalling.py", line 351
with open("/etc/redhat-release", "r") as release_file:
^
SyntaxError: invalid syntax
rlJournalStart: Failed to initialize the journal. Bailing out...
I verified the library using the automated test suite on Fedora 19,
RHEL 6 and RHEL 7. I also manually checked if it works correctly
on RHEL 5 by copying it to /plugins and running few simple tests
the usual way. And, as I've mentioned in comments and previously,
it /should/ work on RHEL3 and later, trivial errors not
withstanding.
Regards,
Hubert
Hubert Kario (7):
new routines for socket based synchronisation
add synchronisation to system library
use internal killtree, to not leave running sleep commands behind
add rlWaitForCmd
change rlWaitForSocket to use shared code
add rlWaitForFile
add tests for all synchronisation routines
src/Makefile | 1 +
src/beakerlib.sh | 1 +
src/synchronisation.sh | 463 ++++++++++++++++++++++++++++++++++++++++
src/test/synchronisationTest.sh | 238 +++++++++++++++++++++
4 files changed, 703 insertions(+)
create mode 100644 src/synchronisation.sh
create mode 100644 src/test/synchronisationTest.sh
--
1.8.3.1
10 years, 4 months
rlCleanup / testwatcher test coverage
by Jiri Jaburek
Hi,
I've been working on (at least some) test coverage for the recently
added rlCleanup* functions and the (rather separate) testwatcher.py
and I found a few bugs in the process as well.
Everything related (patches) should be in References to this email,
see the commit messages or code comments for more details.
Thanks for the review (if any).
Also thanks to Roman Rakus for help with escaping quotes in bash.
-- JJ
10 years, 4 months