]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: do not save/restore ip_forward sysctl 35081/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 15 May 2020 03:13:38 +0000 (20:13 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 15 May 2020 03:15:38 +0000 (20:15 -0700)
We don't really care if this is left on during the course of the mount.
These settings don't persist across tests anyway.

Fixes: https://tracker.ceph.com/issues/45525
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/tasks/cephfs/mount.py

index 2cd34e22533890aa407a1d5627791caa3cbd8a4a..49892df5b8c812082607a868c73f936a08fdd079 100644 (file)
@@ -119,20 +119,7 @@ class CephFSMount(object):
                     "ip addr add {0}/{1} brd {2} dev ceph-brx".format(ip, mask, brd)]
             self.client_remote.run(args=args, timeout=(5*60))
         
-        # Save the ip_forward's old value
-        save_path = "/tmp/python-ceph-brx"
-        if not os.path.exists(save_path):
-            self.client_remote.run(args=['touch', save_path], timeout=(5*60))
-            p = self.client_remote.run(args=['cat', '/proc/sys/net/ipv4/ip_forward'],
-                                       stderr=StringIO(), stdout=StringIO(),
-                                       timeout=(5*60))
-            val = p.stdout.getvalue().strip()
-            args = ["sudo", "bash", "-c",
-                    "echo {0} > {1}".format(val, save_path)]
-            self.client_remote.run(args=args, timeout=(5*60))
-
-        args = ["sudo", "bash", "-c",
-                "echo 1 > /proc/sys/net/ipv4/ip_forward"]
+        args = "echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward"
         self.client_remote.run(args=args, timeout=(5*60))
         
         # Setup the NAT
@@ -303,18 +290,6 @@ class CephFSMount(object):
                 "iptables -t nat -D POSTROUTING -s {0}/{1} -o {2} -j MASQUERADE".format(ip, mask, gw)]
         self.client_remote.run(args=args, timeout=(5*60))
 
-        # Restore the ip_forward
-        save_path = "/tmp/python-ceph-brx"
-        p = self.client_remote.run(args=['cat', save_path],
-                                   stderr=StringIO(), stdout=StringIO(),
-                                   timeout=(5*60))
-        val = p.stdout.getvalue().strip()
-        args = ["sudo", "bash", "-c",
-                "echo {} > /proc/sys/net/ipv4/ip_forward".format(val)]
-        self.client_remote.run(args=args, timeout=(5*60))
-        self.client_remote.run(args=['rm', '-f', save_path],
-                               timeout=(5*60))
-
     def setup_netns(self):
         """
         Setup the netns for the mountpoint.