Bug 1198944 - remove vmware recording support from mochitest; r=khuey
authorNathan Froyd <froydnj@mozilla.com>
Thu, 27 Aug 2015 16:00:14 -0400
changeset 294260 f2857622eb8729e901d71167146db012c887dfc3
parent 294259 10ff4337ccece2d8fbc296ee35a5d991f4e8e362
child 294261 2cef846e92e44191b14235f6b02543c47ae2a61a
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1198944
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1198944 - remove vmware recording support from mochitest; r=khuey VMWare's record/replay bits are unsupported, and they only work with programs compiled with VS2010, which we no longer support.
build/win32/moz.build
build/win32/vmwarerecordinghelper/moz.build
build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp
build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def
testing/mochitest/Makefile.in
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -1,17 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['_MSC_VER'] and CONFIG['OS_TEST'] != 'x86_64':
-    TEST_DIRS += ['vmwarerecordinghelper']
-
 TEST_DIRS += ['crashinjectdll']
 
 if CONFIG['ENABLE_TESTS']:
     Program('crashinject')
     SOURCES += [
         'crashinject.cpp',
     ]
     USE_STATIC_LIBS = True
deleted file mode 100644
--- a/build/win32/vmwarerecordinghelper/moz.build
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
-    'vmwarerecordinghelper.cpp',
-]
-
-SharedLibrary('vmwarerecordinghelper')
-
-DEFFILE = '%s/%s.def' % (SRCDIR, LIBRARY_NAME)
-
-USE_STATIC_LIBS = True
deleted file mode 100644
--- a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * The following code comes from "Starting and Stopping Recording of Virtual
- * Machine Activity from Within the Guest":
- *
- *   http://kb.vmware.com/selfservice/documentLink.do?externalID=1001401
- */
-
-void __cdecl
-StartRecording()
-{
-  __asm {
-    mov eax, 564d5868h
-    mov ebx, 1
-    mov cx, 47
-    mov dx, 5658h
-    in eax, dx
-  }
-}
-
-void __cdecl
-StopRecording()
-{
-  __asm {
-    mov eax, 564d5868h
-    mov ebx, 2
-    mov cx, 47
-    mov dx, 5658h
-    in eax, dx 
-  }
-}
deleted file mode 100644
--- a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def
+++ /dev/null
@@ -1,8 +0,0 @@
-;+# This Source Code Form is subject to the terms of the Mozilla Public
-;+# License, v. 2.0. If a copy of the MPL was not distributed with this
-;+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-LIBRARY vmwarerecordinghelper
-EXPORTS
-     StartRecording
-     StopRecording
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -27,17 +27,16 @@ TEST_HARNESS_BINS := \
   GenerateOCSPResponse$(BIN_SUFFIX) \
   fix_stack_using_bpsyms.py \
   $(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 TEST_HARNESS_BINS += \
   crashinject$(BIN_SUFFIX) \
   crashinjectdll$(DLL_SUFFIX) \
-  vmwarerecordinghelper$(DLL_SUFFIX) \
   $(NULL)
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 TEST_HARNESS_BINS += fix_macosx_stack.py
 endif
 
 ifeq ($(OS_ARCH),Linux)
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -25,19 +25,16 @@ try:
         MachCommandConditions as conditions,
     )
     build_obj = MozbuildObject.from_environment(cwd=here)
 except ImportError:
     build_obj = None
     conditions = None
 
 
-VMWARE_RECORDING_HELPER_BASENAME = "vmwarerecordinghelper"
-
-
 class ArgumentContainer():
     __metaclass__ = ABCMeta
 
     @abstractproperty
     def args(self):
         pass
 
     @abstractproperty
@@ -285,24 +282,16 @@ class MochitestArguments(ArgumentContain
           "suppress": True,
           }],
         [["--testing-modules-dir"],
          {"dest": "testingModulesDir",
           "default": None,
           "help": "Directory where testing-only JS modules are located.",
           "suppress": True,
           }],
-        [["--use-vmware-recording"],
-         {"action": "store_true",
-          "dest": "vmwareRecording",
-          "default": False,
-          "help": "Enables recording while the application is running inside a VMware "
-                  "Workstation 7.0 or later VM.",
-          "suppress": True,
-          }],
         [["--repeat"],
          {"type": int,
           "default": 0,
           "help": "Repeat the tests the given number of times.",
           }],
         [["--run-until-failure"],
          {"action": "store_true",
           "dest": "runUntilFailure",
@@ -622,26 +611,16 @@ class MochitestArguments(ArgumentContain
         elif build_obj:
             options.certPath = os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs')
 
         if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
             options.symbolsPath = self.get_full_path(options.symbolsPath, parser.oldcwd)
         elif not options.symbolsPath and build_obj:
             options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')
 
-        if options.vmwareRecording:
-            if not mozinfo.isWin:
-                parser.error(
-                    "use-vmware-recording is only supported on Windows.")
-            options.vmwareHelperPath = os.path.join(
-                options.utilityPath, VMWARE_RECORDING_HELPER_BASENAME + ".dll")
-            if not os.path.exists(options.vmwareHelperPath):
-                parser.error("%s not found, cannot automate VMware recording." %
-                             options.vmwareHelperPath)
-
         if options.webapprtContent and options.webapprtChrome:
             parser.error(
                 "Only one of --webapprt-content and --webapprt-chrome may be given.")
 
         if options.jsdebugger:
             options.extraPrefs += [
                 "devtools.debugger.remote-enabled=true",
                 "devtools.chrome.enabled=true",
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1212,17 +1212,16 @@ def parseKeyValue(strings, separator='='
             (context, ','.join(missing)), errors=missing)
     return [string.split(separator, 1) for string in strings]
 
 
 class Mochitest(MochitestUtilsMixin):
     _active_tests = None
     certdbNew = False
     sslTunnel = None
-    vmwareHelper = None
     DEFAULT_TIMEOUT = 60.0
     mediaDevices = None
 
     # XXX use automation.py for test name to avoid breaking legacy
     # TODO: replace this with 'runtests.py' or 'mochitest' or the like
     test_name = 'automation.py'
 
     def __init__(self, logger_options):
@@ -1619,47 +1618,16 @@ class Mochitest(MochitestUtilsMixin):
                 self.killAndGetStack(
                     processPID,
                     utilityPath,
                     debuggerInfo,
                     dump_screen=not debuggerInfo)
 
         return foundZombie
 
-    def startVMwareRecording(self, options):
-        """ starts recording inside VMware VM using the recording helper dll """
-        assert mozinfo.isWin
-        from ctypes import cdll
-        self.vmwareHelper = cdll.LoadLibrary(self.vmwareHelperPath)
-        if self.vmwareHelper is None:
-            self.log.warning("runtests.py | Failed to load "
-                             "VMware recording helper")
-            return
-        self.log.info("runtests.py | Starting VMware recording.")
-        try:
-            self.vmwareHelper.StartRecording()
-        except Exception as e:
-            self.log.warning("runtests.py | Failed to start "
-                             "VMware recording: (%s)" % str(e))
-            self.vmwareHelper = None
-
-    def stopVMwareRecording(self):
-        """ stops recording inside VMware VM using the recording helper dll """
-        try:
-            assert mozinfo.isWin
-            if self.vmwareHelper is not None:
-                self.log.info("runtests.py | Stopping VMware recording.")
-                self.vmwareHelper.StopRecording()
-        except Exception as e:
-            self.log.warning("runtests.py | Failed to stop "
-                             "VMware recording: (%s)" % str(e))
-            self.log.exception('Error stopping VMWare recording')
-
-        self.vmwareHelper = None
-
     def runApp(self,
                testUrl,
                env,
                app,
                profile,
                extraArgs,
                utilityPath,
                debuggerInfo=None,
@@ -2237,19 +2205,16 @@ class Mochitest(MochitestUtilsMixin):
             # then again to actually run mochitest
             if options.timeout:
                 timeout = options.timeout + 30
             elif options.debugger or not options.autorun:
                 timeout = None
             else:
                 timeout = 330.0  # default JS harness timeout is 300 seconds
 
-            if options.vmwareRecording:
-                self.startVMwareRecording(options)
-
             # detect shutdown leaks for m-bc runs
             detectShutdownLeaks = mozinfo.info[
                 "debug"] and options.browserChrome and not options.webapprtChrome
 
             self.log.info("runtests.py | Running tests: start.\n")
             try:
                 status = self.runApp(testURL,
                                      self.browserEnv,
@@ -2271,18 +2236,16 @@ class Mochitest(MochitestUtilsMixin):
                 status = -1
             except:
                 traceback.print_exc()
                 self.log.error(
                     "Automation Error: Received unexpected exception while running application\n")
                 status = 1
 
         finally:
-            if options.vmwareRecording:
-                self.stopVMwareRecording()
             self.stopServers()
 
         mozleak.process_leak_log(
             self.leak_report_file,
             leak_thresholds=options.leakThresholds,
             ignore_missing_leaks=options.ignoreMissingLeaks,
             log=self.log,
         )