Skip to content

Commit

Permalink
Merge pull request #8350 from Zaoliang/autofs_utils
Browse files Browse the repository at this point in the history
Add documentation into lib/autofs_utils.pm
  • Loading branch information
SergioAtSUSE committed Sep 25, 2019
2 parents 7c4f9d2 + dd38d8d commit 02b9533
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/autofs_utils.pm
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
=head1 autofs_utils
C<autofs_utils> - Functions for setup autofs server and check autofs service
=cut
package autofs_utils;

use strict;
Expand All @@ -18,6 +23,13 @@ my $test_mount_dir = '/mnt/test_autofs_local';
my $file_to_mount = '/tmp/test-iso.iso';
my $test_conf_file_content = "echo iso -fstype=auto,ro :$file_to_mount > $test_conf_file";

=head2 setup_autofs_server
setup_autofs_server();
Set up an autofs server by using scripts
=cut
sub setup_autofs_server {
my (%args) = @_;
my $grep_output = script_output("grep '#+dir' $args{autofs_conf_file}");
Expand All @@ -28,6 +40,13 @@ sub setup_autofs_server {
assert_script_run($args{test_conf_file_content}, fail_message => "File $args{test_conf_file} could not be created");
}

=head2 check_autofs_service
check_autofs_service();
Check autofs service by starting and stopping service
=cut
sub check_autofs_service {
systemctl 'start autofs';
systemctl 'is-active autofs';
Expand Down

0 comments on commit 02b9533

Please sign in to comment.