Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: client/tests/kvm/tests/image_copy.py

Issue 6124004: Revert "Merge remote branch 'cros/upstream' into autotest-rebase" (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/tests/kvm/tests/guest_test.py ('k') | client/tests/kvm/tests/iofuzz.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/kvm/tests/image_copy.py
diff --git a/client/tests/kvm/tests/image_copy.py b/client/tests/kvm/tests/image_copy.py
deleted file mode 100644
index 87bafea1dd4316cbfbb22d2b79fdbe6970d386d8..0000000000000000000000000000000000000000
--- a/client/tests/kvm/tests/image_copy.py
+++ /dev/null
@@ -1,46 +0,0 @@
-import os, logging, commands
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.bin import utils
-import kvm_utils
-
-
-def run_image_copy(test, params, env):
- """
- Copy guest images from nfs server.
- 1) Mount the NFS share directory
- 2) Check the existence of source image
- 3) If it exists, copy the image from NFS
-
- @param test: kvm test object
- @param params: Dictionary with the test parameters
- @param env: Dictionary with test environment.
- """
- mount_dest_dir = params.get('dst_dir', '/mnt/images')
- if not os.path.exists(mount_dest_dir):
- try:
- os.makedirs(mount_dest_dir)
- except OSError, err:
- logging.warning('mkdir %s error:\n%s', mount_dest_dir, err)
-
- if not os.path.exists(mount_dest_dir):
- raise error.TestError('Failed to create NFS share dir %s' %
- mount_dest_dir)
-
- src = params.get('images_good')
- mnt_cmd = 'mount %s %s -o ro' % (src, mount_dest_dir)
- image = '%s.%s' % (os.path.split(params['image_name'])[1],
- params['image_format'])
- src_path = os.path.join(mount_dest_dir, image)
- dst_path = '%s.%s' % (params['image_name'], params['image_format'])
- cmd = 'cp %s %s' % (src_path, dst_path)
-
- if not kvm_utils.mount(src, mount_dest_dir, 'nfs', 'ro'):
- raise error.TestError('Could not mount NFS share %s to %s' %
- (src, mount_dest_dir))
-
- # Check the existence of source image
- if not os.path.exists(src_path):
- raise error.TestError('Could not find %s in NFS share' % src_path)
-
- logging.debug('Copying image %s...' % image)
- utils.system(cmd)
« no previous file with comments | « client/tests/kvm/tests/guest_test.py ('k') | client/tests/kvm/tests/iofuzz.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698