Skip to content

Commit

Permalink
API: Moving autotest_lib to autotest
Browse files Browse the repository at this point in the history
This patch brings API changes to test writers.

Move autotest_api to a shorter and cleaner
autotest. So all references to

autotest_lib.[lib]

Become

autotest.[lib]

The conversion was made mostly automated by
script.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
  • Loading branch information
lmr committed Apr 18, 2012
1 parent 4ece855 commit 7e83868
Show file tree
Hide file tree
Showing 614 changed files with 1,317 additions and 1,317 deletions.
2 changes: 1 addition & 1 deletion CODING_STYLE
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import sys, time, urllib, urlparse
try:
import autotest.common
except ImportError:
import common # Magic autotest_lib module and sys.path setup code.
import common # Magic autotest module and sys.path setup code.
import MySQLdb # After common so that we check our site-packages first.
from common_lib import error

Expand Down
2 changes: 1 addition & 1 deletion cli/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""

import os, sys
from autotest_lib.cli import topic_common, action_common
from autotest.cli import topic_common, action_common


class acl(topic_common.atest):
Expand Down
2 changes: 1 addition & 1 deletion cli/acl_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import topic_common, action_common, acl, cli_mock
from autotest.cli import topic_common, action_common, acl, cli_mock


class acl_list_unittest(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion cli/action_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"""

import re, socket, types
from autotest_lib.cli import topic_common
from autotest.cli import topic_common


#
Expand Down
4 changes: 2 additions & 2 deletions cli/action_common_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, topic_common, action_common, rpc
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest.cli import cli_mock, topic_common, action_common, rpc
from autotest.frontend.afe.json_rpc import proxy

#
# List action
Expand Down
4 changes: 2 additions & 2 deletions cli/atest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import topic_common
from autotest.cli import topic_common


def main():
Expand Down Expand Up @@ -65,7 +65,7 @@ def main():
elif not os.path.exists(os.path.join(cli_dir, '%s.py' % topic)):
syntax_obj.invalid_syntax('Invalid topic %s' % topic)
topic_module = common.setup_modules.import_module(topic,
'autotest_lib.cli')
'autotest.cli')

# If we have a syntax error now, it should
# refer to the topic class.
Expand Down
2 changes: 1 addition & 1 deletion cli/atest_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock
from autotest.cli import cli_mock


class main_unittest(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion cli/atomicgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""

import os, sys
from autotest_lib.cli import topic_common, action_common
from autotest.cli import topic_common, action_common

class atomicgroup(topic_common.atest):
"""
Expand Down
2 changes: 1 addition & 1 deletion cli/atomicgroup_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, topic_common, atomicgroup
from autotest.cli import cli_mock, topic_common, atomicgroup


class atomicgroup_unittest(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion cli/autotest-rpc-change-protection-level
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try:
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import rpc, host
from autotest.cli import rpc, host

usage = 'usage: %prog [options] new_protection_level machine1 machine2 ...'
parser = optparse.OptionParser(usage=usage)
Expand Down
2 changes: 1 addition & 1 deletion cli/autotest-rpc-client
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ try:
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import atest
from autotest.cli import atest


sys.exit(atest.main())
4 changes: 2 additions & 2 deletions cli/autotest-rpc-compose-query
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ try:
import autotest.common
except ImportError:
import common
from autotest_lib.client.common_lib import kernel_versions
from autotest_lib.tko import display, frontend, db, query_lib
from autotest.client.common_lib import kernel_versions
from autotest.tko import display, frontend, db, query_lib

# First do all the options parsing
parser = optparse.OptionParser()
Expand Down
2 changes: 1 addition & 1 deletion cli/autotest-rpc-migrate-host
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ try:
import autotest.common
except ImportError:
import common
from autotest_lib.server import frontend
from autotest.server import frontend

try:
old = frontend.AFE(web_server='http://' + sys.argv[1])
Expand Down
2 changes: 1 addition & 1 deletion cli/autotest-rpc-query-keyvals
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ try:
import autotest.common
except ImportError:
import common
from autotest_lib.cli import rpc
from autotest.cli import rpc


def parse_options():
Expand Down
4 changes: 2 additions & 2 deletions cli/autotest-rpc-query-results
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ try:
import autotest.common
except ImportError:
import common
from autotest_lib.cli import rpc
from autotest_lib.database import database_connection
from autotest.cli import rpc
from autotest.database import database_connection


# First do all the options parsing
Expand Down
10 changes: 5 additions & 5 deletions cli/cli_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import atest, topic_common, rpc
from autotest_lib.frontend.afe import rpc_client_lib
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest_lib.client.common_lib.test_utils import mock
from autotest_lib.client.common_lib import autotemp
from autotest.cli import atest, topic_common, rpc
from autotest.frontend.afe import rpc_client_lib
from autotest.frontend.afe.json_rpc import proxy
from autotest.client.common_lib.test_utils import mock
from autotest.client.common_lib import autotemp

CLI_USING_PDB = False
CLI_UT_DEBUG = False
Expand Down
2 changes: 1 addition & 1 deletion cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
import setup_modules
sys.path.pop(0)

setup_modules.setup(base_path=autotest_dir, root_module_name="autotest_lib")
setup_modules.setup(base_path=autotest_dir, root_module_name="autotest")
2 changes: 1 addition & 1 deletion cli/contrib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
import setup_modules
sys.path.pop(0)

setup_modules.setup(base_path=autotest_dir, root_module_name="autotest_lib")
setup_modules.setup(base_path=autotest_dir, root_module_name="autotest")
4 changes: 2 additions & 2 deletions cli/contrib/why_isnt_my_job_running.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import rpc, host
from autotest_lib.client.common_lib import host_queue_entry_states
from autotest.cli import rpc, host
from autotest.client.common_lib import host_queue_entry_states

parser = optparse.OptionParser(
usage='Usage: %prog [options] <job id> [<hostname>]\n\n'
Expand Down
4 changes: 2 additions & 2 deletions cli/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"""

import os, sys, socket
from autotest_lib.cli import topic_common, action_common
from autotest_lib.client.common_lib import host_protections
from autotest.cli import topic_common, action_common
from autotest.client.common_lib import host_protections


class host(topic_common.atest):
Expand Down
2 changes: 1 addition & 1 deletion cli/host_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, host
from autotest.cli import cli_mock, host


class host_ut(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion cli/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

import getpass, os, pwd, re, socket, sys
from autotest_lib.cli import topic_common, action_common
from autotest.cli import topic_common, action_common


class job(topic_common.atest):
Expand Down
4 changes: 2 additions & 2 deletions cli/job_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, topic_common, job
from autotest_lib.client.common_lib.test_utils import mock
from autotest.cli import cli_mock, topic_common, job
from autotest.client.common_lib.test_utils import mock


class job_unittest(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion cli/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

import os, sys
from autotest_lib.cli import topic_common, action_common
from autotest.cli import topic_common, action_common


class label(topic_common.atest):
Expand Down
2 changes: 1 addition & 1 deletion cli/label_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, topic_common
from autotest.cli import cli_mock, topic_common


class label_list_unittest(cli_mock.cli_unittest):
Expand Down
6 changes: 3 additions & 3 deletions cli/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#

import os
from autotest_lib.frontend.afe import rpc_client_lib
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest_lib.client.common_lib import global_config, utils
from autotest.frontend.afe import rpc_client_lib
from autotest.frontend.afe.json_rpc import proxy
from autotest.client.common_lib import global_config, utils

GLOBAL_CONFIG = global_config.global_config
DEFAULT_SERVER = 'autotest'
Expand Down
8 changes: 4 additions & 4 deletions cli/rpc_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import rpc
from autotest_lib.client.common_lib import global_config
from autotest_lib.frontend.afe import rpc_client_lib
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest.cli import rpc
from autotest.client.common_lib import global_config
from autotest.frontend.afe import rpc_client_lib
from autotest.frontend.afe.json_rpc import proxy

GLOBAL_CONFIG = global_config.global_config

Expand Down
2 changes: 1 addition & 1 deletion cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
except ImportError:
import common

from autotest_lib.client.common_lib import version
from autotest.client.common_lib import version

# Mostly needed when called one level up
cli_dir = os.path.dirname(sys.modules[__name__].__file__) or '.'
Expand Down
2 changes: 1 addition & 1 deletion cli/site_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import inspect, new, sys

from autotest_lib.cli import topic_common, label
from autotest.cli import topic_common, label


class site_label(label.label):
Expand Down
2 changes: 1 addition & 1 deletion cli/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import os, sys

from autotest_lib.cli import topic_common, action_common
from autotest.cli import topic_common, action_common


class test(topic_common.atest):
Expand Down
2 changes: 1 addition & 1 deletion cli/test_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, topic_common, test
from autotest.cli import cli_mock, topic_common, test


class test_list_unittest(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion cli/threads_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, threads
from autotest.cli import cli_mock, threads


class thread_unittest(cli_mock.cli_unittest):
Expand Down
6 changes: 3 additions & 3 deletions cli/topic_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class __init__() before adding its own parser arguments.

import getpass, optparse, os, pwd, re, socket, sys, textwrap, traceback
import socket, string, urllib2
from autotest_lib.cli import rpc
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest_lib.client.common_lib.test_utils import mock
from autotest.cli import rpc
from autotest.frontend.afe.json_rpc import proxy
from autotest.client.common_lib.test_utils import mock


# Maps the AFE keys to printable names.
Expand Down
4 changes: 2 additions & 2 deletions cli/topic_common_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, topic_common, rpc
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest.cli import cli_mock, topic_common, rpc
from autotest.frontend.afe.json_rpc import proxy


class topic_common_misc_tests(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion cli/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""

import os, sys
from autotest_lib.cli import topic_common, action_common
from autotest.cli import topic_common, action_common


class user(topic_common.atest):
Expand Down
2 changes: 1 addition & 1 deletion cli/user_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import autotest.common as common
except ImportError:
import common
from autotest_lib.cli import cli_mock, user
from autotest.cli import cli_mock, user


class user_list_unittest(cli_mock.cli_unittest):
Expand Down
2 changes: 1 addition & 1 deletion client/autotest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try:
except ImportError:
import common

from autotest_lib.client import autotest_local
from autotest.client import autotest_local

if __name__ == '__main__':
app = autotest_local.AutotestLocalApp()
Expand Down
2 changes: 1 addition & 1 deletion client/autotest-local
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try:
except ImportError:
import common

from autotest_lib.client import autotest_local
from autotest.client import autotest_local

if __name__ == '__main__':
app = autotest_local.AutotestLocalApp()
Expand Down
2 changes: 1 addition & 1 deletion client/autotest_client
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ except ImportError:

import sys, os, time, subprocess

from autotest_lib.client.common_lib import utils
from autotest.client.common_lib import utils

# We want to set the output (stdout&stderr) of the autotest binary onto our
# stdout channel. We went to get the status stream of autotest back on our
Expand Down
Loading

0 comments on commit 7e83868

Please sign in to comment.