Title: [182566] trunk/Tools
Revision
182566
Author
clo...@igalia.com
Date
2015-04-08 14:12:44 -0700 (Wed, 08 Apr 2015)

Log Message

[XvfbDriver] Regular _expression_ used to match running X servers fails on Fedora 22.
https://bugs.webkit.org/show_bug.cgi?id=143530

Reviewed by Žan Doberšek.

Assume that the default value for display (:0) is reserved and start checking on :1
Adjust webkitpy test and include two new test cases for this bug (display number not specified)
and for X server named Xorg.bin (previous bug 1376599)

* Scripts/webkitpy/port/xvfbdriver.py:
(XvfbDriver._next_free_display)
* Scripts/webkitpy/port/xvfbdriver_unittest.py:
(XvfbDriverTest.test_start_no_pixel_tests):
(XvfbDriverTest.test_start_pixel_tests):
(XvfbDriverTest.test_start_arbitrary_worker_number):
(XvfbDriverTest.test_next_free_display):
(XvfbDriverTest.test_start_next_worker):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (182565 => 182566)


--- trunk/Tools/ChangeLog	2015-04-08 21:00:19 UTC (rev 182565)
+++ trunk/Tools/ChangeLog	2015-04-08 21:12:44 UTC (rev 182566)
@@ -1,3 +1,22 @@
+2015-04-08  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [XvfbDriver] Regular _expression_ used to match running X servers fails on Fedora 22.
+        https://bugs.webkit.org/show_bug.cgi?id=143530
+
+        Reviewed by Žan Doberšek.
+
+        Assume that the default value for display (:0) is reserved and start checking on :1
+        Adjust webkitpy test and include two new test cases for this bug (display number not specified)
+        and for X server named Xorg.bin (previous bug 1376599)
+
+        * Scripts/webkitpy/port/xvfbdriver.py:
+        (XvfbDriver._next_free_display)
+        * Scripts/webkitpy/port/xvfbdriver_unittest.py:
+        (XvfbDriverTest.test_start_no_pixel_tests):
+        (XvfbDriverTest.test_start_pixel_tests):
+        (XvfbDriverTest.test_start_arbitrary_worker_number):
+        (XvfbDriverTest.test_next_free_display):
+        (XvfbDriverTest.test_start_next_worker):
 2015-04-08  Alex Christensen  <achristen...@webkit.org>
 
         Block popups from content extensions.

Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py (182565 => 182566)


--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py	2015-04-08 21:00:19 UTC (rev 182565)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py	2015-04-08 21:12:44 UTC (rev 182566)
@@ -62,7 +62,7 @@
             match = re.match('(X|Xvfb|Xorg|Xorg\.bin)\s+.*\s:(?P<screen_number>\d+)', pid)
             if match:
                 reserved_screens.add(int(match.group('screen_number')))
-        for i in range(99):
+        for i in range(1, 99):
             if i not in reserved_screens:
                 _guard_lock_file = self._port.host.filesystem.join('/tmp', 'WebKitXvfb.lock.%i' % i)
                 self._guard_lock = self._port.host.make_file_lock(_guard_lock_file)

Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py (182565 => 182566)


--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py	2015-04-08 21:00:19 UTC (rev 182565)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py	2015-04-08 21:12:44 UTC (rev 182566)
@@ -68,49 +68,59 @@
 
     def test_start_no_pixel_tests(self):
         driver = self.make_driver()
-        expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0")
+        expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
+        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":1")
         self.cleanup_driver(driver)
 
     def test_start_pixel_tests(self):
         driver = self.make_driver()
-        expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
+        expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
+        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":1", pixel_tests=True)
         self.cleanup_driver(driver)
 
     def test_start_arbitrary_worker_number(self):
         driver = self.make_driver(worker_number=17)
-        expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
+        expected_logs = ("MOCK run_command: ['ps', '-eo', 'comm,command'], cwd=None\nMOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
+        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":1", pixel_tests=True)
         self.cleanup_driver(driver)
 
     def test_next_free_display(self):
-        output = "Xorg            /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none\nXvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp"
+        output = "Xorg            /usr/bin/X :1 -auth /var/run/lightdm/root/:1 -nolisten tcp vt7 -novtswitch -background none\nXvfb            Xvfb :2 -screen 0 800x600x24 -nolisten tcp"
         executive = MockExecutive2(output)
         driver = self.make_driver(executive=executive)
+        self.assertEqual(driver._next_free_display(), 3)
+        self.cleanup_driver(driver)
+        output = "X               /usr/bin/X :1 vt7 -nolisten tcp -auth /var/run/xauth/A:0-8p7Ybb"
+        executive = MockExecutive2(output)
+        driver = self.make_driver(executive=executive)
         self.assertEqual(driver._next_free_display(), 2)
         self.cleanup_driver(driver)
-        output = "X               /usr/bin/X :0 vt7 -nolisten tcp -auth /var/run/xauth/A:0-8p7Ybb"
+        output = "Xvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp"
         executive = MockExecutive2(output)
         driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 1)
+        self.assertEqual(driver._next_free_display(), 2)
         self.cleanup_driver(driver)
-        output = "Xvfb            Xvfb :0 -screen 0 800x600x24 -nolisten tcp"
+        output = "Xvfb            Xvfb :2 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :3 -screen 0 800x600x24 -nolisten tcp"
         executive = MockExecutive2(output)
         driver = self.make_driver(executive=executive)
-        self.assertEqual(driver._next_free_display(), 1)
+        self.assertEqual(driver._next_free_display(), 4)
         self.cleanup_driver(driver)
-        output = "Xvfb            Xvfb :1 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :0 -screen 0 800x600x24 -nolisten tcp\nXvfb            Xvfb :3 -screen 0 800x600x24 -nolisten tcp"
+        output = "Xorg.bin        /usr/libexec/Xorg.bin :1 -background none -noreset -verbose 3 -logfile /dev/null -auth /run/gdm/auth-for-gdm-Zt8Eq2/database -seat seat0 -nolisten tcp vt1"
         executive = MockExecutive2(output)
         driver = self.make_driver(executive=executive)
         self.assertEqual(driver._next_free_display(), 2)
         self.cleanup_driver(driver)
+        output = "/usr/libexec/Xorg            vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3"
+        executive = MockExecutive2(output)
+        driver = self.make_driver(executive=executive)
+        self.assertEqual(driver._next_free_display(), 1)
+        self.cleanup_driver(driver)
 
     def test_start_next_worker(self):
         driver = self.make_driver()
-        driver._next_free_display = lambda: 0
-        expected_logs = ("MOCK popen: ['Xvfb', ':0', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
-        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":0", pixel_tests=True)
+        driver._next_free_display = lambda: 1
+        expected_logs = ("MOCK popen: ['Xvfb', ':1', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
+        self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":1", pixel_tests=True)
         self.cleanup_driver(driver)
         driver = self.make_driver()
         driver._next_free_display = lambda: 3
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to