-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scenarios: added a scenario for detecting NFS name resolution failures (
#876) Fixes #716 Signed-off-by: Mustafa Kemal Gilor <[email protected]>
- Loading branch information
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
hotsos/defs/scenarios/storage/nfs/nfs-detect-mount-name-resolution-failure.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
checks: | ||
has_nfs_name_resolution_failures: | ||
input: | ||
path: ['var/log/syslog', 'var/log/boot.log'] | ||
expr: '.*mount.nfs.*Failed to resolve server (.*): (Name or service not known|Temporary failure in name resolution).*' | ||
conclusions: | ||
nfs_name_resolution_failures: | ||
decision: has_nfs_name_resolution_failures | ||
raises: | ||
type: NFSNameResolutionError | ||
message: >- | ||
Name resolution failures have been detected for the following NFS mounts: | ||
{names} | ||
format-dict: | ||
names: '@checks.has_nfs_name_resolution_failures.search.results_group_1:unique_comma_join' |
12 changes: 12 additions & 0 deletions
12
hotsos/defs/tests/scenarios/storage/nfs/nfs-name-or-service-not-known.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
target-name: nfs-detect-mount-name-resolution-failure.yaml | ||
data-root: | ||
files: | ||
var/log/syslog: | | ||
Aug 23 07:27:31 juju-0c7157-trilio-test-16 mount[809]: mount.nfs: Failed to resolve server my.great.nfsserver.org: Name or service not known | ||
Oct 9 11:28:22 mail mount[714]: mount.nfs4: Failed to resolve server my.another.great.nfs.org: Temporary failure in name resolution | ||
copy-from-original: | ||
- sos_commands/date/date | ||
raised-issues: | ||
NFSNameResolutionError: >- | ||
Name resolution failures have been detected for the following NFS mounts: | ||
my.another.great.nfs.org, my.great.nfsserver.org |
14 changes: 14 additions & 0 deletions
14
hotsos/defs/tests/scenarios/storage/nfs/nfs-temporary-name-resolution-failure.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
target-name: nfs-detect-mount-name-resolution-failure.yaml | ||
data-root: | ||
files: | ||
var/log/boot.log: | | ||
mount.nfs: Failed to resolve server filesrv23: Temporary failure in name resolution | ||
mountall: mount /epgbatch_data [623] terminated with status 32 | ||
mount.nfs: Failed to resolve server filesrv24: Temporary failure in name resolution | ||
mountall: mount /epgbatch_data [632] terminated with status 32 | ||
copy-from-original: | ||
- sos_commands/date/date | ||
raised-issues: | ||
NFSNameResolutionError: >- | ||
Name resolution failures have been detected for the following NFS mounts: | ||
filesrv23, filesrv24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
from hotsos.core.config import HotSOSConfig | ||
|
||
from .. import utils | ||
|
||
|
||
class StorageNFSTestsBase(utils.BaseTestCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
HotSOSConfig.plugin_name = 'storage' | ||
|
||
|
||
@utils.load_templated_tests('scenarios/storage/nfs') | ||
class TestNFSScenarios(StorageNFSTestsBase): | ||
""" | ||
Scenario tests can be written using YAML templates that are auto-loaded | ||
into this test runner. This is the recommended way to write tests for | ||
scenarios. It is however still possible to write the tests in Python if | ||
required. See https://hotsos.readthedocs.io/en/latest/contrib/testing.html | ||
for more information. | ||
""" |