Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate 'Permission settings' of atsec into openQA
- Loading branch information
Showing
2 changed files
with
36 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
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,35 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright 2022 SUSE LLC | ||
# SPDX-License-Identifier: FSFAP | ||
# | ||
# Summary: Run 'Permission settings of relevant configuration files' test case of ATSec test suite | ||
# Maintainer: xiaojing.liu <xiaojing.liu@suse.com> | ||
# Tags: poo#111518 | ||
|
||
use base 'consoletest'; | ||
use strict; | ||
use warnings; | ||
use testapi; | ||
use utils; | ||
|
||
sub run { | ||
my ($self) = shift; | ||
|
||
select_console 'root-console'; | ||
|
||
my $output = script_output('find -L /etc -perm -g+w,o+w'); | ||
|
||
# The expected result is all files found should be a softlink to /dev/null or /dev/random | ||
foreach my $file (split('\n', $output)) { | ||
my $file_detail = script_output("ll $file"); | ||
if ($file_detail !~ /$file\s+->\s+(\/dev\/null|\/dev\/random)/) { | ||
|
||
# The file is not a softlink or doesn't link to expected device | ||
record_info($file, $file_detail, result => 'fail'); | ||
$self->result('fail'); | ||
} | ||
} | ||
} | ||
|
||
1; |