22import logging
33import signal
44from textwrap import dedent
5- from tasks .cephfs .fuse_mount import FuseMount
65from tasks .cephfs .cephfs_test_case import CephFSTestCase
76from teuthology .orchestra .run import Raw
87from teuthology .exceptions import CommandFailedError
@@ -63,9 +62,6 @@ def test_kill_mdstable(self):
6362 """
6463 check snaptable transcation
6564 """
66- if not isinstance (self .mount_a , FuseMount ):
67- self .skipTest ("Require FUSE client to forcibly kill mount" )
68-
6965 self .fs .set_allow_new_snaps (True );
7066 self .fs .set_max_mds (2 )
7167 status = self .fs .wait_for_daemons ()
@@ -123,8 +119,7 @@ def test_kill_mdstable(self):
123119
124120 self .fs .rank_signal (signal .SIGKILL , rank = 1 )
125121
126- self .mount_a .kill ()
127- self .mount_a .kill_cleanup ()
122+ self .mount_a .suspend_netns ()
128123
129124 self .fs .rank_fail (rank = 0 )
130125 self .fs .mds_restart (rank0 ['name' ])
@@ -149,7 +144,13 @@ def test_kill_mdstable(self):
149144 else :
150145 self .assertGreater (self ._get_last_created_snap (rank = 0 ), last_created )
151146
152- self .mount_a .mount_wait ()
147+ self .mount_a .resume_netns ()
148+ try :
149+ proc .wait ()
150+ except CommandFailedError :
151+ pass
152+ self .mount_a .remount ()
153+ self .fs .flush ()
153154
154155 self .mount_a .run_shell (["rmdir" , Raw ("d1/dir/.snap/*" )])
155156
@@ -169,8 +170,7 @@ def test_kill_mdstable(self):
169170 self .wait_until_true (lambda : "laggy_since" in self .fs .get_rank (rank = 1 ), timeout = self .fs .beacon_timeout );
170171 self .delete_mds_coredump (rank1 ['name' ]);
171172
172- self .mount_a .kill ()
173- self .mount_a .kill_cleanup ()
173+ self .mount_a .suspend_netns ()
174174
175175 if i in [3 ,4 ]:
176176 self .assertEqual (len (self ._get_pending_snap_update (rank = 0 )), 1 )
@@ -190,7 +190,13 @@ def test_kill_mdstable(self):
190190 else :
191191 self .assertGreater (self ._get_last_created_snap (rank = 0 ), last_created )
192192
193- self .mount_a .mount_wait ()
193+ self .mount_a .resume_netns ()
194+ try :
195+ proc .wait ()
196+ except CommandFailedError :
197+ pass
198+ self .mount_a .remount ()
199+ self .fs .flush ()
194200
195201 self .mount_a .run_shell (["rmdir" , Raw ("d1/dir/.snap/*" )])
196202
@@ -211,8 +217,7 @@ def test_kill_mdstable(self):
211217 self .wait_until_true (lambda : "laggy_since" in self .fs .get_rank (rank = 1 ), timeout = self .fs .beacon_timeout );
212218 self .delete_mds_coredump (rank1 ['name' ]);
213219
214- self .mount_a .kill ()
215- self .mount_a .kill_cleanup ()
220+ self .mount_a .suspend_netns ()
216221
217222 self .assertEqual (len (self ._get_pending_snap_update (rank = 0 )), 1 )
218223
@@ -232,7 +237,13 @@ def test_kill_mdstable(self):
232237 self .wait_until_true (lambda : len (self ._get_pending_snap_update (rank = 0 )) == 0 , timeout = 30 )
233238 self .assertEqual (self ._get_last_created_snap (rank = 0 ), last_created )
234239
235- self .mount_a .mount_wait ()
240+ self .mount_a .resume_netns ()
241+ try :
242+ proc .wait ()
243+ except CommandFailedError :
244+ pass
245+ self .mount_a .remount ()
246+ self .fs .flush ()
236247
237248 def test_snapclient_cache (self ):
238249 """
@@ -327,8 +338,7 @@ def _check_snapclient_cache(snaps_dump, cache_dump=None, rank=0):
327338 self .wait_until_true (lambda : "laggy_since" in self .fs .get_rank (rank = 2 ), timeout = self .fs .beacon_timeout );
328339 self .delete_mds_coredump (rank2 ['name' ]);
329340
330- self .mount_a .kill ()
331- self .mount_a .kill_cleanup ()
341+ self .mount_a .suspend_netns ()
332342
333343 self .assertEqual (len (self ._get_pending_snap_update (rank = 0 )), 1 )
334344
@@ -356,7 +366,13 @@ def _check_snapclient_cache(snaps_dump, cache_dump=None, rank=0):
356366 self .assertEqual (snaps_dump ["last_created" ], rank0_cache ["last_created" ])
357367 self .assertTrue (_check_snapclient_cache (snaps_dump , cache_dump = rank0_cache ));
358368
359- self .mount_a .mount_wait ()
369+ self .mount_a .resume_netns ()
370+ try :
371+ proc .wait ()
372+ except CommandFailedError :
373+ pass
374+ self .mount_a .remount ()
375+ self .fs .flush ()
360376
361377 self .mount_a .run_shell (["rmdir" , Raw ("d0/d2/dir/.snap/*" )])
362378
0 commit comments