1414 limitations under the License.
1515*/
1616
17- package sys
17+ package mount
1818
1919import (
2020 "io/ioutil"
@@ -32,7 +32,7 @@ import (
3232type fMountatCaseFunc func (t * testing.T , root string )
3333
3434func TestFMountat (t * testing.T ) {
35- if ! runningPrivileged () {
35+ if unix . Geteuid () != 0 {
3636 t .Skip ("Needs to be run as root" )
3737 return
3838 }
@@ -88,7 +88,7 @@ func testFMountatNormal(t *testing.T, root string) {
8888 defer f .Close ()
8989
9090 // mount work to fs
91- if err = FMountat (f .Fd (), workdir , "fs" , "bind" , unix .MS_BIND | unix .MS_RDONLY , "" ); err != nil {
91+ if err = fMountat (f .Fd (), workdir , "fs" , "bind" , unix .MS_BIND | unix .MS_RDONLY , "" ); err != nil {
9292 t .Fatalf ("expected no error here, but got error: %+v" , err )
9393 }
9494 defer umount (t , fsdir )
@@ -124,7 +124,7 @@ func testFMountatWithFileFd(t *testing.T, root string) {
124124 }
125125 defer f .Close ()
126126
127- err = FMountat (f .Fd (), filepath .Join (root , "empty" ), filepath .Join (root , "work" ), "" , 0 , "" )
127+ err = fMountat (f .Fd (), filepath .Join (root , "empty" ), filepath .Join (root , "work" ), "" , 0 , "" )
128128 if ! errors .Is (err , expectedErr ) {
129129 t .Fatalf ("expected error %v, but got %v" , expectedErr , errors .Cause (err ))
130130 }
@@ -145,7 +145,7 @@ func testFMountatWithInvalidSource(t *testing.T, root string) {
145145 }
146146 defer f .Close ()
147147
148- err = FMountat (f .Fd (), filepath .Join (root , "oops" ), "at" , "bind" , unix .MS_BIND , "" )
148+ err = fMountat (f .Fd (), filepath .Join (root , "oops" ), "at" , "bind" , unix .MS_BIND , "" )
149149 if ! errors .Is (err , expectedErr ) {
150150 t .Fatalf ("expected error %v, but got %v" , expectedErr , err )
151151 }
0 commit comments