-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #508 from yast/fstab_agent_test
Fstab agent test
- Loading branch information
Showing
2 changed files
with
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env rspec | ||
|
||
require_relative "../test_helper" | ||
require "yast" | ||
|
||
describe ".proc.meminfo" do | ||
around :each do |example| | ||
root = File.join(File.dirname(__FILE__), "test_root") | ||
change_scr_root(root, &example) | ||
end | ||
|
||
describe ".Read" do | ||
let(:content) { Yast::SCR.Read(path(".etc.fstab")) } | ||
|
||
it "reads content of /etc/fstab and returns array" do | ||
expect(content).to be_a(Array) | ||
end | ||
|
||
it "returns an array containing nfs entries" do | ||
expect(content).to satisfy { |r| r.find { |e| e["file"] == "/home/kv2" } } | ||
expect(content).to satisfy { |r| r.find { |e| e["file"] == "/media/new" } } | ||
expect(content).to satisfy { |r| r.find { |e| e["file"] == "/media/new2" } } | ||
end | ||
|
||
it "returns an array containing tmpfs entry" do | ||
expect(content).to satisfy { |r| r.find { |e| e["file"] == "/tmp" } } | ||
end | ||
|
||
it "is able to parse comments" do | ||
pending "need to be fixed" | ||
expect(content).to include("#comment") | ||
end | ||
end | ||
end |
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,7 @@ | ||
UUID=b66c1028-cd4a-4c08-b92d-fc4b9840845d / ext4 noatime,data=writeback,acl,user_xattr 1 1 | ||
UUID=d2811ace-66e0-4ef2-9b68-9b2758359391 /home ext4 noatime,data=writeback,acl 1 2 | ||
192.168.1.2:/home/kv /home/kv2 nfs defaults 0 0 | ||
192.168.1.2:/media/new2 /media/new2 nfs defaults 0 0 | ||
192.168.1.2:/media/new /media/new nfs defaults 0 0 | ||
# my fine comment | ||
tmpfs /tmp tmpfs defaults,size=25% 0 0 |