Skip to content

Commit

Permalink
[WIP] Fstab agent - handle better white space only lines (bsc#1030425) (
Browse files Browse the repository at this point in the history
#570)

* Added a fstab white space test

* Fstab agent - workaround for white space only lines (bsc#1030425)

* Added a comment

* 3.2.28
  • Loading branch information
lslezak committed Apr 19, 2017
1 parent 19f8d42 commit 64d1cd4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
9 changes: 8 additions & 1 deletion library/general/src/scrconf/etc_fstab.scr
Expand Up @@ -42,10 +42,17 @@
*/
.etc.fstab

/*
* Note: the same agent definition is used in
* https://github.com/yast/yast-update/blob/e2052274034f5240e9f09bceae7c6d888b18468d/src/modules/RootPart.rb#L812
* apply any fixes also there.
*/

`ag_anyagent(
`Description (
(`File("/etc/fstab")), // real file name
"#\n", // Comment
// tab and space is a workaround for white space only lines (bsc#1030425)
"#\n\t ", // Comment
false, // read-only
(`List (
`Tuple (
Expand Down
7 changes: 7 additions & 0 deletions library/general/test/agents_test/fstab_agent_test.rb
Expand Up @@ -21,7 +21,14 @@
root = File.join(File.dirname(__FILE__), "test_root2")
change_scr_root(root)
expect(content).to be_a(Array)
end

it "can read fstab containing just whitespace lines" do
reset_scr_root
root = File.join(File.dirname(__FILE__), "test_root3")
change_scr_root(root)
# all lines are returned
expect(content.size).to eq(6)
end

it "returns an array containing nfs entries" do
Expand Down
8 changes: 8 additions & 0 deletions library/general/test/agents_test/test_root3/etc/fstab
@@ -0,0 +1,8 @@
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
6 changes: 6 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Apr 19 14:16:33 UTC 2017 - lslezak@suse.cz

- Fixed parsing whitespace lines in /etc/fstab (bsc#1030425)
- 3.2.28

-------------------------------------------------------------------
Mon Apr 10 15:23:06 UTC 2017 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 3.2.27
Version: 3.2.28
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit 64d1cd4

Please sign in to comment.