[*] complete migration from molecule.git, fix Makefile and tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
SUBDIRS = plugins
|
||||
SUBDIRS = src
|
||||
PREFIX = /usr
|
||||
BINDIR = $(PREFIX)/bin
|
||||
DESTDIR =
|
||||
|
||||
@@ -25,9 +25,10 @@ from molecule.compat import get_stringtype
|
||||
from molecule.i18n import _
|
||||
from molecule.output import red, brown, blue, green, purple, darkgreen, \
|
||||
darkred, bold, darkblue, readtext
|
||||
import molecule.utils
|
||||
from molecule.specs.skel import GenericExecutionStep, GenericSpec
|
||||
|
||||
import molecule.utils
|
||||
|
||||
class BuiltinHandlerMixin:
|
||||
"""
|
||||
This class contains code in common between built-in handler classes.
|
||||
@@ -26,11 +26,13 @@ import errno
|
||||
from molecule.i18n import _
|
||||
from molecule.output import blue, darkred
|
||||
from molecule.specs.skel import GenericExecutionStep, GenericSpec
|
||||
from molecule.specs.plugins.builtin_plugin import BuiltinHandlerMixin
|
||||
from molecule.specs.plugins.remaster_plugin import IsoUnpackHandler as \
|
||||
RemasterIsoUnpackHandler, ChrootHandler as RemasterChrootHandler
|
||||
|
||||
import molecule.utils
|
||||
|
||||
from .builtin_plugin import BuiltinHandlerMixin
|
||||
from .remaster_plugin import IsoUnpackHandler as RemasterIsoUnpackHandler, \
|
||||
ChrootHandler as RemasterChrootHandler
|
||||
|
||||
|
||||
class ImageHandler(GenericExecutionStep, BuiltinHandlerMixin):
|
||||
|
||||
@@ -23,9 +23,11 @@ import errno
|
||||
from molecule.i18n import _
|
||||
from molecule.output import blue, darkred
|
||||
from molecule.specs.skel import GenericExecutionStep, GenericSpec
|
||||
from molecule.specs.plugins.builtin_plugin import BuiltinHandlerMixin
|
||||
|
||||
import molecule.utils
|
||||
|
||||
from .builtin_plugin import BuiltinHandlerMixin
|
||||
|
||||
|
||||
class ChrootHandler(GenericExecutionStep, BuiltinHandlerMixin):
|
||||
|
||||
@@ -24,15 +24,14 @@ from molecule.i18n import _
|
||||
from molecule.output import red, blue, green, purple, darkgreen, \
|
||||
darkred, bold, darkblue, readtext
|
||||
from molecule.specs.skel import GenericExecutionStep, GenericSpec
|
||||
from molecule.specs.plugins.builtin_plugin import ChrootHandler as \
|
||||
BuiltinChrootHandler
|
||||
from molecule.specs.plugins.builtin_plugin import CdrootHandler as \
|
||||
BuiltinCdrootHandler
|
||||
from molecule.specs.plugins.builtin_plugin import IsoHandler as \
|
||||
BuiltinIsoHandler
|
||||
from molecule.specs.plugins.builtin_plugin import BuiltinHandlerMixin
|
||||
|
||||
import molecule.utils
|
||||
|
||||
from .builtin_plugin import ChrootHandler as BuiltinChrootHandler
|
||||
from .builtin_plugin import CdrootHandler as BuiltinCdrootHandler
|
||||
from .builtin_plugin import IsoHandler as BuiltinIsoHandler
|
||||
from .builtin_plugin import BuiltinHandlerMixin
|
||||
|
||||
class IsoUnpackHandler(GenericExecutionStep, BuiltinHandlerMixin):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -22,9 +22,9 @@ import shutil
|
||||
from molecule.i18n import _
|
||||
from molecule.output import blue, darkred
|
||||
from molecule.specs.skel import GenericExecutionStep, GenericSpec
|
||||
from molecule.specs.plugins.builtin_plugin import BuiltinHandlerMixin
|
||||
from molecule.specs.plugins.remaster_plugin import IsoUnpackHandler, \
|
||||
ChrootHandler
|
||||
|
||||
from .builtin_plugin import BuiltinHandlerMixin
|
||||
from .remaster_plugin import IsoUnpackHandler, ChrootHandler
|
||||
import molecule.utils
|
||||
|
||||
SUPPORTED_COMPRESSION_METHODS = ["bz2", "gz"]
|
||||
+4
-4
@@ -23,7 +23,7 @@ class ParsersTest(unittest.TestCase):
|
||||
|
||||
def test_iso_remaster(self):
|
||||
|
||||
from molecule.specs.plugins.remaster_plugin import RemasterSpec
|
||||
from src.remaster_plugin import RemasterSpec
|
||||
|
||||
expected_data = {
|
||||
'execution_strategy': "iso_remaster",
|
||||
@@ -65,7 +65,7 @@ class ParsersTest(unittest.TestCase):
|
||||
|
||||
def test_chroot_to_iso(self):
|
||||
|
||||
from molecule.specs.plugins.builtin_plugin import LivecdSpec
|
||||
from src.builtin_plugin import LivecdSpec
|
||||
|
||||
expected_data = {
|
||||
'execution_strategy': "livecd",
|
||||
@@ -144,7 +144,7 @@ class ParsersTest(unittest.TestCase):
|
||||
|
||||
def test_iso_to_tar(self):
|
||||
|
||||
from molecule.specs.plugins.tar_plugin import IsoToTarSpec
|
||||
from src.tar_plugin import IsoToTarSpec
|
||||
|
||||
expected_data = {
|
||||
'execution_strategy': "iso_to_tar",
|
||||
@@ -185,7 +185,7 @@ class ParsersTest(unittest.TestCase):
|
||||
|
||||
def test_iso_to_image(self):
|
||||
|
||||
from molecule.specs.plugins.image_plugin import IsoToImageSpec
|
||||
from src.image_plugin import IsoToImageSpec
|
||||
|
||||
expected_data = {
|
||||
'execution_strategy': "iso_to_image",
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
#!/usr/bin/python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Simulate PYTHONPATH, add our plugin directory
|
||||
MODULE_DIR = os.path.abspath("../")
|
||||
sys.path.insert(0, MODULE_DIR)
|
||||
# Add /usr/lib/molecule to PYTHONPATH
|
||||
sys.path.append("/usr/lib/molecule")
|
||||
|
||||
_plugins = [
|
||||
"src.builtin_plugin",
|
||||
"src.remaster_plugin",
|
||||
"src.mmc_plugin",
|
||||
"src.image_plugin",
|
||||
"src.tar_plugin"]
|
||||
os.environ["MOLECULE_PLUGIN_MODULES"] = ":".join(_plugins)
|
||||
|
||||
|
||||
import unittest
|
||||
sys.path.insert(0,'.')
|
||||
sys.path.insert(0,'..')
|
||||
|
||||
from tests import version, utils, specs, parsers
|
||||
from tests import parsers
|
||||
rc = 0
|
||||
|
||||
# Add to the list the module to test
|
||||
mods = [version, utils, specs, parsers]
|
||||
mods = [parsers]
|
||||
|
||||
tests = []
|
||||
for mod in mods:
|
||||
|
||||
Reference in New Issue
Block a user