Skip to content

Commit

Permalink
Make path of /etc/fstab configurable for test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Jan 2, 2018
1 parent 5302e75 commit 8c7fce9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/Nfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def main

# list of created directories
@created_dirs = []

# Filename with path of the fstab file. Configurable mostly for the test suite.
@etc_fstab_name = "/etc/fstab"
end

# Function sets internal variable, which indicates, that any
Expand Down Expand Up @@ -296,7 +299,7 @@ def read_etc_fstab
return if @skip_fstab

# TO DO: Prepend $target to path (maybe running in the inst-sys?)
fstab = EtcFstab.new("/etc/fstab")
fstab = EtcFstab.new(@etc_fstab_name)
nfs_entries = fstab.entries.select { |e| e.fs_type.start_with?("nfs") }
@nfs_entries = nfs_entries.map do |entry|
share = {}
Expand All @@ -315,7 +318,7 @@ def write_etc_fstab
backup_etc_fstab

# TO DO: Prepend $target to path (maybe running in the inst-sys?)
fstab = EtcFstab.new("/etc/fstab")
fstab = EtcFstab.new(@etc_fstab_name)
merge_entries(fstab)
remove_unknown_shares(fstab)
fstab.fix_mount_order
Expand Down Expand Up @@ -719,6 +722,7 @@ def ProbeExports(server, v4)
publish variable: :nfs4_enabled, type: "boolean"
publish variable: :nfs_gss_enabled, type: "boolean"
publish variable: :idmapd_domain, type: "string"
publish variable: :etc_fstab_name, type: "string"
publish function: :Import, type: "boolean (map <string, any>)"
publish function: :Export, type: "map ()"
publish function: :FindPortmapper, type: "string ()"
Expand Down

0 comments on commit 8c7fce9

Please sign in to comment.