Skip to content

Commit

Permalink
test the refactoring. caught a corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed May 22, 2013
1 parent 5cea091 commit e74271d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/Nfs.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
* extract the options and the NFS fstab entries.
*/
void GetOptionsAndEntries(list<map> settings, map & global_options, list<map<string, any> > & entries) {
if (haskey (settings[0]:$[], "enable_nfs4")) {
if (haskey (settings[0]:$[], "enable_nfs4") ||
haskey (settings[0]:$[], "idmapd_domain")) {
global_options = settings[0]:$[];
settings = remove(settings, 0);
}
Expand Down
5 changes: 5 additions & 0 deletions testsuite/tests/autoyast.out
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Dump - basic, SLE11-SP3
Read .sysconfig.nfs.NFS_SECURITY_GSS "no"
Return true
Dump -- and Export
Dump - NFSv4 via vfstype
Read .sysconfig.nfs.NFS4_SUPPORT "no"
Read .sysconfig.nfs.NFS_SECURITY_GSS "no"
Return true
Dump -- and Export
Dump - with GSS
Return true
Dump -- and Export
33 changes: 33 additions & 0 deletions testsuite/tests/autoyast.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,39 @@
Assert::Equal("/mirror", e[1, "mount_point"]:"");
Assert::Equal("defaults", e[1, "nfs_options"]:"");

// ---------
DUMP("- NFSv4 via vfstype");
map global_options2 = $[
"idmapd_domain": "example.com"
];
map entry2 = $[
"server_path": "data.example.com:/mirror",
"mount_point": "/mirror",
"nfs_options": "defaults",
"vfstype": "nfs4"
];

TEST (``(
Nfs::Import([
global_options2,
entry2
])
), [READ, $[], $[]], nil);

Assert::Equal(true, Nfs::nfs4_enabled);
Assert::Equal("example.com", Nfs::idmapd_domain);
Assert::Equal(1, size(Nfs::nfs_entries));
Assert::Equal("data.example.com:/mirror", Nfs::nfs_entries[0, "spec"]:"");

DUMP("-- and Export");
e = Nfs::Export();
Assert::Equal(2, size(e));
Assert::Equal(true, e[0, "enable_nfs4"]:false);
Assert::Equal("example.com", e[0, "idmapd_domain"]:"");
Assert::Equal("data.example.com:/mirror", e[1, "server_path"]:"");
Assert::Equal("/mirror", e[1, "mount_point"]:"");
Assert::Equal("defaults", e[1, "nfs_options"]:"");

// ---------
DUMP("- with GSS");
global_options = $[
Expand Down

0 comments on commit e74271d

Please sign in to comment.