• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from autotest_lib.client.bin import test, utils
6from autotest_lib.client.common_lib import error
7
8import subprocess
9
10class network_GobiUncleanDisconnect(test.test):
11    version = 1
12
13    def unclean_disconnect(self, iteration):
14        rv = subprocess.call(['/usr/bin/libgobi3k/open-abort'])
15        print 'Iteration %d: %d' % (iteration, rv)
16        if rv != -9:
17            # subprocess communicates kills by returning the signal value,
18            # negated.
19            raise error.TestFail('Unexpected exit status %d' % rv)
20
21    def run_once(self, iterations=10):
22        for iteration in xrange(iterations):
23            self.unclean_disconnect(iteration)
24