summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Duraffort <remi.duraffort@linaro.org>2014-11-21 13:47:49 (GMT)
committerRémi Duraffort <remi.duraffort@linaro.org>2014-11-21 13:49:01 (GMT)
commit764b8ccaf1ea6b364ede460e0d1aa31b9e3d2f66 (patch)
tree11f759da8e19e7de6dae58369715d877a08f2a38
parentce8f09951b77f1bbd035c465c7ab4ab16156df3e (diff)
downloadlava-dispatcher-764b8ccaf1ea6b364ede460e0d1aa31b9e3d2f66.tar.gz
lava-dispatcher-764b8ccaf1ea6b364ede460e0d1aa31b9e3d2f66.tar.xz
Remove ChecksumAction
This actions is empty as the download action is already computing checksums on the fly. Change-Id: I792bfc25e73679b49bd8c88422f1ce6c07da31ce
-rw-r--r--lava_dispatcher/pipeline/actions/deploy/download.py25
-rw-r--r--lava_dispatcher/pipeline/actions/deploy/image.py2
-rw-r--r--lava_dispatcher/pipeline/test/test_defs.py2
-rw-r--r--lava_dispatcher/pipeline/test/test_job.py73
4 files changed, 30 insertions, 72 deletions
diff --git a/lava_dispatcher/pipeline/actions/deploy/download.py b/lava_dispatcher/pipeline/actions/deploy/download.py
index a3a2fe9..fd60e9f 100644
--- a/lava_dispatcher/pipeline/actions/deploy/download.py
+++ b/lava_dispatcher/pipeline/actions/deploy/download.py
@@ -173,6 +173,8 @@ class DownloadHandler(Action):
'md5': md5.hexdigest(),
'sha256': sha256.hexdigest()
}
+ self.logger.debug("md5sum of downloaded content: %s" % (md5.hexdigest()))
+ self.logger.debug("sha256sum of downloaded content: %s" % (sha256.hexdigest()))
return connection
@@ -290,29 +292,6 @@ class ScpDownloadAction(DownloadHandler):
pass
-class ChecksumAction(Action): # FIXME: fold into the DownloadHandler
- """
- retrieves the checksums from the dynamic data
- """
-
- def __init__(self):
- super(ChecksumAction, self).__init__()
- self.name = "checksum_action"
- self.description = "md5sum and sha256sum"
- self.summary = "checksum"
-
- def run(self, connection, args=None):
- if 'download_action' in self.data:
- if 'md5' in self.data['download_action']:
- self.logger.debug("md5sum of downloaded content: %s" %
- self.data['download_action']['md5'])
- if 'sha256' in self.data['download_action']:
- self.logger.debug("sha256sum of downloaded content: %s" %
- self.data['download_action']['sha256'])
- # TODO: if the checksums are not present, compute them now
- return connection
-
-
class QCowConversionAction(Action):
"""
explicit action for qcow conversion to avoid reliance
diff --git a/lava_dispatcher/pipeline/actions/deploy/image.py b/lava_dispatcher/pipeline/actions/deploy/image.py
index 807cb9a..ffde90b 100644
--- a/lava_dispatcher/pipeline/actions/deploy/image.py
+++ b/lava_dispatcher/pipeline/actions/deploy/image.py
@@ -21,7 +21,6 @@
from lava_dispatcher.pipeline.action import Deployment, Pipeline
from lava_dispatcher.pipeline.actions.deploy import DeployAction
from lava_dispatcher.pipeline.actions.deploy.download import (
- ChecksumAction,
DownloaderAction,
QCowConversionAction,
)
@@ -55,7 +54,6 @@ class DeployImageAction(DeployAction):
self.internal_pipeline.add_action(download)
if parameters.get('format', '') == 'qcow2':
self.internal_pipeline.add_action(QCowConversionAction('image'))
- self.internal_pipeline.add_action(ChecksumAction())
self.internal_pipeline.add_action(MountAction())
self.internal_pipeline.add_action(CustomisationAction())
self.internal_pipeline.add_action(OverlayAction()) # idempotent, includes testdef
diff --git a/lava_dispatcher/pipeline/test/test_defs.py b/lava_dispatcher/pipeline/test/test_defs.py
index 99a9bb9..39f3e49 100644
--- a/lava_dispatcher/pipeline/test/test_defs.py
+++ b/lava_dispatcher/pipeline/test/test_defs.py
@@ -51,7 +51,7 @@ class TestDefinitionHandlers(unittest.TestCase): # pylint: disable=too-many-pub
for action in self.job.pipeline.actions:
self.assertIsNotNone(action.name)
if isinstance(action, DeployAction):
- overlay = action.pipeline.children[action.pipeline][4]
+ overlay = action.pipeline.children[action.pipeline][3]
testdef = overlay.internal_pipeline.actions[2]
self.assertEqual(len(overlay.internal_pipeline.actions), 4)
self.assertIsInstance(testdef, TestDefinitionAction)
diff --git a/lava_dispatcher/pipeline/test/test_job.py b/lava_dispatcher/pipeline/test/test_job.py
index cc036fc..85e288b 100644
--- a/lava_dispatcher/pipeline/test/test_job.py
+++ b/lava_dispatcher/pipeline/test/test_job.py
@@ -25,7 +25,6 @@ import unittest
from lava_dispatcher.pipeline.action import Pipeline, Action, RetryAction, JobError
from lava_dispatcher.pipeline.test.test_basic import Factory
from lava_dispatcher.pipeline.actions.deploy.download import (
- ChecksumAction,
DownloaderAction,
DownloadHandler,
FileDownloadAction,
@@ -171,10 +170,10 @@ class TestKVMBasicDeploy(unittest.TestCase):
apply_overlay = None
overlay = None
unmount = None
- self.assertEqual(len(self.job.pipeline.describe().values()), 32) # this will keep changing until KVM is complete.
+ self.assertEqual(len(self.job.pipeline.describe().values()), 31) # this will keep changing until KVM is complete.
for action in self.job.pipeline.actions:
if isinstance(action, DeployAction):
- self.assertEqual(len(action.pipeline.children[action.pipeline]), 7)
+ self.assertEqual(len(action.pipeline.children[action.pipeline]), 6)
# check parser has created a suitable deployment
download_retry = action.pipeline.children[action.pipeline][0]
self.assertIsInstance(download_retry, DownloaderAction)
@@ -190,13 +189,7 @@ class TestKVMBasicDeploy(unittest.TestCase):
self.assertIsInstance(download.log_handler, logging.FileHandler)
self.assertIsInstance(download.logger, YamlLogger)
- checksum = action.pipeline.children[action.pipeline][1]
- self.assertEqual(checksum.name, "checksum_action")
- self.assertIsInstance(checksum, ChecksumAction)
- self.assertIsInstance(checksum.log_handler, logging.FileHandler)
- self.assertIsInstance(checksum.logger, YamlLogger)
-
- mount = action.pipeline.children[action.pipeline][2]
+ mount = action.pipeline.children[action.pipeline][1]
self.assertIsInstance(mount.internal_pipeline, Pipeline)
self.assertEqual(mount.name, "mount_action")
self.assertIsInstance(mount, MountAction)
@@ -224,25 +217,25 @@ class TestKVMBasicDeploy(unittest.TestCase):
self.assertIsInstance(loop_mount.log_handler, logging.FileHandler)
self.assertIsInstance(loop_mount.logger, YamlLogger)
- customise = action.pipeline.children[action.pipeline][3]
+ customise = action.pipeline.children[action.pipeline][2]
self.assertEqual(customise.name, "customise")
self.assertIsInstance(customise, CustomisationAction)
self.assertIsInstance(customise.log_handler, logging.FileHandler)
self.assertIsInstance(customise.logger, YamlLogger)
- overlay = action.pipeline.children[action.pipeline][4]
+ overlay = action.pipeline.children[action.pipeline][3]
self.assertEqual(overlay.name, "lava-overlay")
self.assertIsInstance(overlay, OverlayAction)
self.assertIsInstance(overlay.log_handler, logging.FileHandler)
self.assertIsInstance(overlay.logger, YamlLogger)
- apply_overlay = action.pipeline.children[action.pipeline][5]
+ apply_overlay = action.pipeline.children[action.pipeline][4]
self.assertEqual(apply_overlay.name, "apply-overlay-image")
self.assertIsInstance(apply_overlay, ApplyOverlayImage)
self.assertIsInstance(apply_overlay.log_handler, logging.FileHandler)
self.assertIsInstance(apply_overlay.logger, YamlLogger)
- unmount = action.pipeline.children[action.pipeline][6]
+ unmount = action.pipeline.children[action.pipeline][5]
self.assertEqual(unmount.name, "umount-retry")
self.assertIsInstance(unmount, UnmountAction)
self.assertIsInstance(unmount, RetryAction)
@@ -284,16 +277,16 @@ class TestKVMBasicDeploy(unittest.TestCase):
for action in self.job.pipeline.actions:
if isinstance(action, DeployAction):
# check parser has created a suitable deployment
- mount = action.pipeline.children[action.pipeline][2]
+ mount = action.pipeline.children[action.pipeline][1]
self.assertIsInstance(mount.internal_pipeline, Pipeline)
self.assertIsInstance(mount, MountAction)
- customise = action.pipeline.children[action.pipeline][3]
+ customise = action.pipeline.children[action.pipeline][2]
self.assertIsInstance(customise, CustomisationAction)
- apply_overlay = action.pipeline.children[action.pipeline][5]
+ apply_overlay = action.pipeline.children[action.pipeline][4]
self.assertIsInstance(apply_overlay, ApplyOverlayImage)
- overlay = action.pipeline.children[action.pipeline][4]
+ overlay = action.pipeline.children[action.pipeline][3]
self.assertIsInstance(overlay, OverlayAction)
- unmount = action.pipeline.children[action.pipeline][6]
+ unmount = action.pipeline.children[action.pipeline][5]
self.assertIsInstance(unmount, UnmountAction)
self.assertTrue(mount.valid)
self.assertEqual(len(mount.internal_pipeline.actions), 3)
@@ -306,7 +299,7 @@ class TestKVMBasicDeploy(unittest.TestCase):
for action in self.job.pipeline.actions:
self.assertIsNotNone(action.name)
if isinstance(action, DeployAction):
- overlay = action.pipeline.children[action.pipeline][4]
+ overlay = action.pipeline.children[action.pipeline][3]
self.assertIsNotNone(overlay)
# these tests require that lava-dispatcher itself is installed, not just running tests from a git clone
self.assertTrue(os.path.exists(overlay.lava_test_dir))
@@ -363,10 +356,10 @@ class TestKVMQcow2Deploy(unittest.TestCase):
apply_overlay = None
overlay = None
unmount = None
- self.assertEqual(len(self.job.pipeline.describe().values()), 33) # this will keep changing until KVM is complete.
+ self.assertEqual(len(self.job.pipeline.describe().values()), 32) # this will keep changing until KVM is complete.
for action in self.job.pipeline.actions:
if isinstance(action, DeployAction):
- self.assertEqual(len(action.pipeline.children[action.pipeline]), 8)
+ self.assertEqual(len(action.pipeline.children[action.pipeline]), 7)
# check parser has created a suitable deployment
download_retry = action.pipeline.children[action.pipeline][0]
self.assertIsInstance(download_retry, DownloaderAction)
@@ -388,13 +381,7 @@ class TestKVMQcow2Deploy(unittest.TestCase):
self.assertIsInstance(convert.log_handler, logging.FileHandler)
self.assertIsInstance(convert.logger, YamlLogger)
- checksum = action.pipeline.children[action.pipeline][2]
- self.assertEqual(checksum.name, "checksum_action")
- self.assertIsInstance(checksum, ChecksumAction)
- self.assertIsInstance(checksum.log_handler, logging.FileHandler)
- self.assertIsInstance(checksum.logger, YamlLogger)
-
- mount = action.pipeline.children[action.pipeline][3]
+ mount = action.pipeline.children[action.pipeline][2]
self.assertIsInstance(mount.internal_pipeline, Pipeline)
self.assertEqual(mount.name, "mount_action")
self.assertIsInstance(mount, MountAction)
@@ -422,25 +409,25 @@ class TestKVMQcow2Deploy(unittest.TestCase):
self.assertIsInstance(loop_mount.log_handler, logging.FileHandler)
self.assertIsInstance(loop_mount.logger, YamlLogger)
- customise = action.pipeline.children[action.pipeline][4]
+ customise = action.pipeline.children[action.pipeline][3]
self.assertEqual(customise.name, "customise")
self.assertIsInstance(customise, CustomisationAction)
self.assertIsInstance(customise.log_handler, logging.FileHandler)
self.assertIsInstance(customise.logger, YamlLogger)
- overlay = action.pipeline.children[action.pipeline][5]
+ overlay = action.pipeline.children[action.pipeline][4]
self.assertEqual(overlay.name, "lava-overlay")
self.assertIsInstance(overlay, OverlayAction)
self.assertIsInstance(overlay.log_handler, logging.FileHandler)
self.assertIsInstance(overlay.logger, YamlLogger)
- apply_overlay = action.pipeline.children[action.pipeline][6]
+ apply_overlay = action.pipeline.children[action.pipeline][5]
self.assertEqual(apply_overlay.name, "apply-overlay-image")
self.assertIsInstance(apply_overlay, ApplyOverlayImage)
self.assertIsInstance(apply_overlay.log_handler, logging.FileHandler)
self.assertIsInstance(apply_overlay.logger, YamlLogger)
- unmount = action.pipeline.children[action.pipeline][7]
+ unmount = action.pipeline.children[action.pipeline][6]
self.assertEqual(unmount.name, "umount-retry")
self.assertIsInstance(unmount, UnmountAction)
self.assertIsInstance(unmount, RetryAction)
@@ -494,10 +481,10 @@ class TestKVMDownloadLocalDeploy(unittest.TestCase):
apply_overlay = None
overlay = None
unmount = None
- self.assertEqual(len(self.job.pipeline.describe().values()), 32) # this will keep changing until KVM is complete.
+ self.assertEqual(len(self.job.pipeline.describe().values()), 31) # this will keep changing until KVM is complete.
for action in self.job.pipeline.actions:
if isinstance(action, DeployAction):
- self.assertEqual(len(action.pipeline.children[action.pipeline]), 7)
+ self.assertEqual(len(action.pipeline.children[action.pipeline]), 6)
# check parser has created a suitable deployment
download_retry = action.pipeline.children[action.pipeline][0]
self.assertIsInstance(download_retry, DownloaderAction)
@@ -513,13 +500,7 @@ class TestKVMDownloadLocalDeploy(unittest.TestCase):
self.assertIsInstance(download.log_handler, logging.FileHandler)
self.assertIsInstance(download.logger, YamlLogger)
- checksum = action.pipeline.children[action.pipeline][1]
- self.assertEqual(checksum.name, "checksum_action")
- self.assertIsInstance(checksum, ChecksumAction)
- self.assertIsInstance(checksum.log_handler, logging.FileHandler)
- self.assertIsInstance(checksum.logger, YamlLogger)
-
- mount = action.pipeline.children[action.pipeline][2]
+ mount = action.pipeline.children[action.pipeline][1]
self.assertIsInstance(mount.internal_pipeline, Pipeline)
self.assertEqual(mount.name, "mount_action")
self.assertIsInstance(mount, MountAction)
@@ -547,25 +528,25 @@ class TestKVMDownloadLocalDeploy(unittest.TestCase):
self.assertIsInstance(loop_mount.log_handler, logging.FileHandler)
self.assertIsInstance(loop_mount.logger, YamlLogger)
- customise = action.pipeline.children[action.pipeline][3]
+ customise = action.pipeline.children[action.pipeline][2]
self.assertEqual(customise.name, "customise")
self.assertIsInstance(customise, CustomisationAction)
self.assertIsInstance(customise.log_handler, logging.FileHandler)
self.assertIsInstance(customise.logger, YamlLogger)
- overlay = action.pipeline.children[action.pipeline][4]
+ overlay = action.pipeline.children[action.pipeline][3]
self.assertEqual(overlay.name, "lava-overlay")
self.assertIsInstance(overlay, OverlayAction)
self.assertIsInstance(overlay.log_handler, logging.FileHandler)
self.assertIsInstance(overlay.logger, YamlLogger)
- apply_overlay = action.pipeline.children[action.pipeline][5]
+ apply_overlay = action.pipeline.children[action.pipeline][4]
self.assertEqual(apply_overlay.name, "apply-overlay-image")
self.assertIsInstance(apply_overlay, ApplyOverlayImage)
self.assertIsInstance(apply_overlay.log_handler, logging.FileHandler)
self.assertIsInstance(apply_overlay.logger, YamlLogger)
- unmount = action.pipeline.children[action.pipeline][6]
+ unmount = action.pipeline.children[action.pipeline][5]
self.assertEqual(unmount.name, "umount-retry")
self.assertIsInstance(unmount, UnmountAction)
self.assertIsInstance(unmount, RetryAction)