@@ -33,30 +33,35 @@ var nfs_server_butane = conf.Butane(`variant: fcos
33
33
version: 1.5.0
34
34
storage:
35
35
directories:
36
- - path: /var/nfs1/share
36
+ - path: /var/nfs/share1
37
37
mode: 0777
38
- - path: /var/nfs2/share
38
+ - path: /var/nfs/share2
39
39
mode: 0777
40
- - path: /var/nfs3/share
40
+ - path: /var/nfs/share3
41
41
mode: 0777
42
- - path: /var/nfs4/share
42
+ - path: /var/nfs/share4
43
43
mode: 0777
44
- - path: /var/nfs5/share
44
+ - path: /var/nfs/share5
45
45
mode: 0777
46
- - path: /var/nfs6/share
46
+ - path: /var/nfs/share6
47
47
mode: 0777
48
48
files:
49
49
- path: "/etc/exports"
50
50
overwrite: true
51
51
contents:
52
52
inline: |
53
- /var/nfs1/share *(rw,insecure,no_root_squash)
54
- /var/nfs2/share *(rw,insecure,no_root_squash)
55
- /var/nfs3/share *(rw,insecure,no_root_squash)
56
- /var/nfs4/share *(rw,insecure,no_root_squash)
57
- /var/nfs5/share *(rw,insecure,no_root_squash)
58
- /var/nfs6/share *(rw,insecure,no_root_squash)
53
+ /var/nfs *(rw,no_root_squash,insecure,fsid=0)
54
+ /var/nfs/share1 *(rw,no_root_squash,insecure)
55
+ /var/nfs/share2 *(rw,no_root_squash,insecure)
56
+ /var/nfs/share3 *(rw,no_root_squash,insecure)
57
+ /var/nfs/share4 *(rw,no_root_squash,insecure)
58
+ /var/nfs/share5 *(rw,no_root_squash,insecure)
59
+ /var/nfs/share6 *(rw,no_root_squash,insecure)
59
60
- path: "/var/lib/nfs/etab"
61
+ user:
62
+ name: nfsnobody
63
+ group:
64
+ name: nfsnobody
60
65
systemd:
61
66
units:
62
67
- name: "nfs-server.service"
@@ -92,7 +97,6 @@ func setupNFSMachine(c cluster.TestCluster) NfsServer {
92
97
},
93
98
}
94
99
options .MinMemory = 2048
95
-
96
100
// start the machine
97
101
switch c := c .Cluster .(type ) {
98
102
// These cases have to be separated because when put together to the same case statement
@@ -112,8 +116,10 @@ func setupNFSMachine(c cluster.TestCluster) NfsServer {
112
116
113
117
// Wait for nfs server to become active
114
118
err = util .Retry (6 , 10 * time .Second , func () error {
115
- nfs_status := c .MustSSH (m , "systemctl is-active nfs-server.service" )
116
- if string (nfs_status ) != "active" {
119
+ nfs_status , err := c .SSH (m , "systemctl is-active nfs-server.service" )
120
+ if err != nil {
121
+ return err
122
+ } else if string (nfs_status ) != "active" {
117
123
return fmt .Errorf ("nfs-server.service is not ready: %s." , string (nfs_status ))
118
124
}
119
125
return nil
@@ -170,8 +176,7 @@ storage:
170
176
sleep 0.5;
171
177
done;
172
178
done) &
173
- done
174
- ` )
179
+ done` )
175
180
opts := platform.MachineOptions {
176
181
MinMemory : 2048 ,
177
182
}
@@ -190,8 +195,10 @@ storage:
190
195
191
196
// Wait for test machine
192
197
err = util .Retry (6 , 10 * time .Second , func () error {
198
+ // entry point /var/nfs with fsid=0 will be root for clients
199
+ // refer to https://access.redhat.com/solutions/107793
193
200
_ = c .MustSSHf (nfs_client , `for i in $(seq 6); do
194
- sudo mount -t nfs4 %s:/var/nfs$i/share /var/tmp/data$i
201
+ sudo mount -t nfs4 %s:/share$i /var/tmp/data$i
195
202
done` , nfs_server .MachineAddress )
196
203
197
204
mounts := c .MustSSH (nfs_client , "sudo df -Th | grep nfs | wc -l" )
@@ -210,7 +217,7 @@ storage:
210
217
211
218
func doSyncTest (c cluster.TestCluster , client platform.Machine ) {
212
219
c .RunCmdSync (client , "sudo touch /var/tmp/data3/test" )
213
- // Continue write
220
+ // Continue writing while doing test
214
221
go func () {
215
222
_ , err := c .SSH (client , "sudo sh /usr/local/bin/nfs-random-write.sh" )
216
223
if err != nil {
0 commit comments