@@ -128,49 +128,6 @@ func TestRuntimeWriteProcessPid(t *testing.T) {
128128 assertFileContent (t , pidFilePath , fmt .Sprintf ("%d" , pid ))
129129}
130130
131- func TestRuntimeProxyInheritsCorrectNamespace (t * testing.T ) {
132- if os .Geteuid () != 0 {
133- t .Skip ("requires root privileges to create new namespaces" )
134- }
135-
136- rootDir := t .TempDir ()
137- remoteprocName := "a-lovely-blue-device"
138- sim := remoteproc .NewSimulator (rootDir ).WithName (remoteprocName )
139- if err := sim .Start (); err != nil {
140- t .Fatalf ("failed to run simulator: %s" , err )
141- }
142- defer func () { _ = sim .Stop () }()
143-
144- bin , err := repo .BuildRuntimeBin (t .TempDir (), rootDir , nil )
145- require .NoError (t , err )
146-
147- const containerName = "blue-container"
148- bundlePath := t .TempDir ()
149-
150- require .NoError (t , generateBundle (
151- bundlePath ,
152- remoteprocName ,
153- specs.LinuxNamespace {Type : specs .MountNamespace },
154- ))
155-
156- _ , err = invokeRuntime (bin , "create" , "--bundle" , bundlePath , containerName )
157- require .NoError (t , err )
158-
159- pid , err := getContainerPid (bin , containerName )
160- require .NoError (t , err )
161- require .Greater (t , pid , 0 )
162-
163- hostMountNS , err := os .Readlink ("/proc/self/ns/mnt" )
164- require .NoError (t , err )
165- proxyMountNS , err := os .Readlink (fmt .Sprintf ("/proc/%d/ns/mnt" , pid ))
166- require .NoError (t , err )
167-
168- assert .NotEqual (t , hostMountNS , proxyMountNS )
169-
170- _ , err = invokeRuntime (bin , "delete" , containerName )
171- require .NoError (t , err )
172- }
173-
174131func TestRuntimeProxyKeepsHostNamespaceWhenNotRoot (t * testing.T ) {
175132 if os .Geteuid () == 0 {
176133 t .Skip ("this test must be run as non-root" )
@@ -229,10 +186,6 @@ func getContainerPid(bin repo.RuntimeBin, containerName string) (int, error) {
229186}
230187
231188func getContainerState (bin repo.RuntimeBin , containerName string ) (specs.State , error ) {
232- return getContainerStateWithEnv (bin , containerName )
233- }
234-
235- func getContainerStateWithEnv (bin repo.RuntimeBin , containerName string ) (specs.State , error ) {
236189 var state specs.State
237190 out , err := invokeRuntime (bin , "state" , containerName )
238191 if err != nil {
0 commit comments