blob: 4aea5c2090cc975b13b5d3cbe37a4da3331bfd7f [file] [log] [blame]
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging, os, shutil, platform
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
class realtimecomm_GTalkunittest(test.test):
version = 1
unittests = [
# On ARM, skip:
# call_unittest (doesn't build)
# media_unittest (doesn't build)
# flute_unittest (doesn't build)
arm_unittests = [
def run_once(self):
# Stop Google Talk Plugin.'pkill GoogleTalkPlugin', ignore_status=True)
# Setup as appropriate.
talk_path = os.path.join(self.autodir, 'talk')
shutil.rmtree(talk_path, ignore_errors=True)
shutil.copytree(os.path.join(self.bindir, 'talk'), talk_path)'chown chronos %s -R' % talk_path)
'chown chronos /tmp/.google-talk-plugin-theuser.lock.testlock',
if "arm" in platform.machine().lower():
unit_tests_to_run = self.arm_unittests
unit_tests_to_run = self.unittests
# Run all unittests.
for test_exe in unit_tests_to_run:
if not os.path.exists(os.path.join(talk_path, test_exe)):
raise error.TestFail('Missing test binary %s. Make sure gtalk '
'has been emerged.' % test_exe)
# The unittest has to be run in 'talk' folder.
test_cmd = "cd %s && su chronos -c \'./%s\'" % (talk_path,
# Clean up.
def __run_one_test(self, test_cmd):'Running %s' % test_cmd)
result =
if '[ FAILED ]' in result.stdout:
raise error.TestFail(result.stdout)'%s passed.' % test_cmd)