Skip to content

Commit

Permalink
xfstests/partition.pm: add section name when configuring nfsmount.con…
Browse files Browse the repository at this point in the history
…f file

several xfstests in o3/xfstests_nfs3-generic fails with
config error at /etc/nfsmount.conf:1: ignoring line not in a section
so, adding the section name in nfsmount config file

Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
  • Loading branch information
Avinesh committed Nov 8, 2024
1 parent 885466c commit 838d772
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/xfstests/partition.pm
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,16 @@ sub setup_nfs_server {
if ($nfsversion == '3') {
assert_script_run("echo 'MOUNT_NFS_V3=\"yes\"' >> /etc/sysconfig/nfs");
assert_script_run("echo 'MOUNT_NFS_DEFAULT_PROTOCOL=3' >> /etc/sysconfig/autofs && echo 'OPTIONS=\"-O vers=3\"' >> /etc/sysconfig/autofs");
assert_script_run("echo 'Defaultvers=3' >> /etc/nfsmount.conf && echo 'Nfsvers=3' >> /etc/nfsmount.conf");
assert_script_run("echo '[NFSMount_Global_Options]' >> /etc/nfsmount.conf && echo 'Defaultvers=3' >> /etc/nfsmount.conf && echo 'Nfsvers=3' >> /etc/nfsmount.conf");
}
else {
assert_script_run("sed -i 's/NFSV4LEASETIME=\"\"/NFSV4LEASETIME=\"$nfsgrace\"/' /etc/sysconfig/nfs");
assert_script_run("echo -e '[nfsd]\\ngrace-time=$nfsgrace\\nlease-time=$nfsgrace' > /etc/nfs.conf.local");
}
assert_script_run('exportfs -a && systemctl restart rpcbind && systemctl enable nfs-server.service && systemctl restart nfs-server');

record_info('nfsmount.conf file', script_output("cat /etc/nfsmount.conf"));

# There's a graceful time we need to wait before using the NFS server
my $gracetime = script_output('cat /proc/fs/nfsd/nfsv4gracetime;');
sleep($gracetime * 2);
Expand Down

0 comments on commit 838d772

Please sign in to comment.