示例#1
0
def schema(live=False):
    base = {
        Required("method"): Msg("docker", "'method' should be 'docker'"),
        Required("command"): str,
        Optional("prompts"): boot.prompts(),
    }
    return {**boot.schema(live), **base}
示例#2
0
def schema():
    base = {
        Required("method"): Msg("minimal", "'method' should be 'minimal'"),
        Optional("prompts"): boot.prompts(),
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(), **base}
示例#3
0
文件: gdb.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("gdb", "'method' should be 'gdb'"),
        Required("commands"): str,
        Optional("container"): str,
    }
    return {**boot.schema(live), **base}
示例#4
0
def _schema_1():
    """Returns Voluptuous Schema object."""
    return Schema({
        Required('schema'): 1,
        Required('bugzilla'): {
            Required('product'): All(str, Length(min=1)),
            Required('component'): All(str, Length(min=1)),
        },
        'origin': {
            Required('name'): All(str, Length(min=1)),
            Required('description'): All(str, Length(min=1)),
            Required('url'): FqdnUrl(),
            Required('license'): Msg(License(), msg='Unsupported License'),
            Required('release'): All(str, Length(min=1)),
        },
        'vendoring': {
            Required('url'): FqdnUrl(),
            Required('revision'): Match(r'^[a-fA-F0-9]{12,40}$'),
            'patches': Unique([str]),
            'keep': Unique([str]),
            'exclude': Unique([str]),
            'include': Unique([str]),
            'run_after': Unique([str]),
        },
    })
示例#5
0
def schema(live=False):
    base = {
        Required("method"): Msg("depthcharge", "'method' should be 'depthcharge'"),
        Required("commands"): Any(str, [str]),
        Optional("use_bootscript"): bool,
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(live), **base}
示例#6
0
def schema():
    base = {
        Required("method"): Msg("uuu", "'method' should be 'uuu'"),
        Required("commands"): Any(str, [{
            str: str
        }]),
    }
    return {**boot.schema(), **base}
示例#7
0
文件: schroot.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("schroot", "'method' should be 'schroot'"),
        Optional("prompts"): boot.prompts(),
        Required("connection"): "ssh",
        Required("schroot"): str,
    }
    return {**boot.schema(live), **base}
示例#8
0
文件: ssh.py 项目: slawr/lava
def schema():
    base = {
        Required("method"): Msg("ssh", "'method' should be 'ssh'"),
        Optional("prompts"): boot.prompts(),
        Required("connection"): "ssh",
    }
    ret = {**boot.schema(), **base}
    ret.update({"parameters": {Optional("hostID"): str, Optional("host_key"): str}})
    return ret
示例#9
0
文件: fastboot.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("fastboot", "'method' should be 'fastboot'"),
        Optional("commands"): [str],
        Optional("use_bootscript"): bool,
        Optional("prompts"): boot.prompts(),
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(live), **base}
示例#10
0
文件: bootloader.py 项目: slawr/lava
def schema():
    base = {
        Required("method"): Msg("bootloader", "'method' should be 'bootloader'"),
        Required("bootloader"): str,
        Required("commands"): [str],
        Optional("use_bootscript"): bool,
        Optional("prompts"): boot.prompts(),
    }
    return {**boot.schema(), **base}
示例#11
0
文件: qemu_iso.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("qemu-iso", "'method' should be 'qemu-iso'"),
        Required("media"): "img",
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
    }
    return {**boot.schema(live), **base}
示例#12
0
文件: qemu_nfs.py 项目: slawr/lava
def schema():
    base = {
        Required("method"): Msg("qemu-nfs", "'method' should be 'qemu-nfs'"),
        Optional("connection"): "serial",  # FIXME: is this needed or required?
        Optional("prompts"): boot.prompts(),
        Optional("transfer_overlay"): boot.transfer_overlay(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
    }
    return {**boot.schema(), **base}
示例#13
0
def schema():
    base = {
        Required("method"): Msg("minimal", "'method' should be 'minimal'"),
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
        Optional("reset"): bool,
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(), **base}
示例#14
0
文件: barebox.py 项目: slawr/lava
def schema():
    base = {
        Required("method"): Msg("barebox", "'method' should be 'barebox'"),
        Required("commands"): Any(str, [str]),
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(), **base}
示例#15
0
文件: uefi_menu.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("uefi-menu", "'method' should be 'uefi-menu'"),
        Optional("commands"): str,
        Optional("line_separator"): str,
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
    }
    return {**boot.schema(live), **base}
示例#16
0
文件: uefi.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("uefi", "'method' should be 'uefi'"),
        Required("commands"): Any(str, [str]),
        Optional("shell_menu"): str,
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
    }
    return {**boot.schema(live), **base}
示例#17
0
def schema(live=False):
    base = {
        Required("method"): Msg("u-boot", "'method' should be 'u-boot'"),
        Required("commands"): Any(str, [str]),
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
        Optional("use_bootscript"): bool,
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(live), **base}
示例#18
0
def schema():
    base = {
        Required("method"): Msg("fastboot", "'method' should be 'fastboot'"),
        Optional("commands"): [str],
        Optional("use_bootscript"): bool,
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
        Optional("transfer_overlay"): boot.transfer_overlay(),
        Optional("docker"): docker(),
    }
    return {**boot.schema(), **base}
示例#19
0
文件: fvp.py 项目: Mattlk13/lava
def schema():
    base = {
        Required("method"): Msg("fvp", "'method' should be 'fvp'"),
        Required("console_string"): str,
        Required("image"): str,
        Optional("license_variable"): str,
        Optional("version_string"): str,
        Required("arguments"): [str],
        Required("prompts"): boot.prompts(),
        Required("docker"): docker("name"),
    }
    return {**boot.schema(), **base}
示例#20
0
def schema():
    base = {
        Required("method"): Msg(
            "new_connection", "'method' should be 'new_connection'"
        ),
        Required("connection"): str,
        Optional("prompts"): boot.prompts(),
        Optional(
            "auto_login"
        ): boot.auto_login(),  # TODO: if auto_login => prompt is required
        Optional("transfer_overlay"): boot.transfer_overlay(),
    }
    return {**boot.schema(), **base}
示例#21
0
def schema(live=False):
    base = {
        Required("method"): Msg("kexec", "'method' should be 'kexec'"),
        Required("boot_message"): str,
        Optional("prompts"): boot.prompts(),
        Optional("command"): str,
        Optional("kernel"): str,
        Optional("dtb"): str,
        Optional("initrd"): str,
        Optional("options"): [str],
        Optional("kernel-config"): str,
    }
    return {**boot.schema(live), **base}
示例#22
0
文件: kexec.py 项目: mytxyang/lava
def schema():
    base = {
        Required("method"): Msg("kexec", "'method' should be 'kexec'"),
        Required("boot_message"): str,
        Optional("prompts"): boot.prompts(),
        Optional("auto_login"):
        boot.auto_login(),  # TODO: if auto_login => prompt is required
        Optional("command"): str,
        Optional("kernel"): str,
        Optional("dtb"): str,
        Optional("initrd"): str,
        Optional("options"): [str],
        Optional("kernel-config"): str,
    }
    return {**boot.schema(), **base}
示例#23
0
文件: fvp.py 项目: iwamatsu/lava
def schema():
    base = {
        Required("method"): Msg("fvp", "'method' should be 'fvp'"),
        Optional("use_telnet"): bool,
        Required("console_string"): str,
        Optional("feedbacks"): [str],
        Required("image"): str,
        Optional("license_variable"): str,
        Optional("version_string"): str,
        Required("arguments"): [str],
        Required("prompts"): boot.prompts(),
        Required("docker"): docker("name"),
        Optional("transfer_overlay"): boot.transfer_overlay(),
        Optional("auto_login"): boot.auto_login(),
    }
    return {**boot.schema(), **base}
示例#24
0
def schema(live=False):
    base = {Required("method"): Msg("pyocd", "'method' should be 'pyocd'")}
    return {**boot.schema(live), **base}
示例#25
0
def _schema_1():
    """Returns Voluptuous Schema object."""
    return Schema({
        Required("schema"): 1,
        Required("bugzilla"): {
            Required("product"): All(str, Length(min=1)),
            Required("component"): All(str, Length(min=1)),
        },
        "origin": {
            Required("name"):
            All(str, Length(min=1)),
            Required("description"):
            All(str, Length(min=1)),
            Required("url"):
            FqdnUrl(),
            Required("license"):
            Msg(License(), msg="Unsupported License"),
            "license-file":
            All(str, Length(min=1)),
            Required("release"):
            All(str, Length(min=1)),
            # The following regex defines a valid git reference
            # The first group [^ ~^:?*[\]] matches 0 or more times anything
            # that isn't a Space, ~, ^, :, ?, *, or ]
            # The second group [^ ~^:?*[\]\.]+ matches 1 or more times
            # anything that isn't a Space, ~, ^, :, ?, *, [, ], or .
            Required("revision"):
            Match(r"^[^ ~^:?*[\]]*[^ ~^:?*[\]\.]+$"),
        },
        "updatebot": {
            Required("maintainer-phab"):
            All(str, Length(min=1)),
            Required("maintainer-bz"):
            All(str, Length(min=1)),
            "tracking":
            All(str, Length(min=1)),
            "tasks":
            All(
                UpdatebotTasks(),
                [{
                    Required("type"):
                    In(
                        ["vendoring", "commit-alert"],
                        msg="Invalid type specified in tasks",
                    ),
                    "branch":
                    All(str, Length(min=1)),
                    "enabled":
                    Boolean(),
                    "cc":
                    Unique([str]),
                    "needinfo":
                    Unique([str]),
                    "filter":
                    In(
                        ["none", "security", "source-extensions"],
                        msg="Invalid filter value specified in tasks",
                    ),
                    "source-extensions":
                    Unique([str]),
                    "frequency":
                    Match(r"^(every|release|[1-9][0-9]* weeks?)$"),
                    "platform":
                    Match(r"^(windows|linux)$"),
                }],
            ),
        },
        "vendoring": {
            Required("url"):
            FqdnUrl(),
            Required("source-hosting"):
            All(
                str,
                Length(min=1),
                In(VALID_SOURCE_HOSTS, msg="Unsupported Source Hosting"),
            ),
            "vendor-directory":
            All(str, Length(min=1)),
            "patches":
            Unique([str]),
            "keep":
            Unique([str]),
            "exclude":
            Unique([str]),
            "include":
            Unique([str]),
            "update-actions":
            All(
                UpdateActions(),
                [{
                    Required("action"):
                    In(
                        [
                            "copy-file",
                            "replace-in-file",
                            "run-script",
                            "delete-path",
                        ],
                        msg="Invalid action specified in update-actions",
                    ),
                    "from":
                    All(str, Length(min=1)),
                    "to":
                    All(str, Length(min=1)),
                    "pattern":
                    All(str, Length(min=1)),
                    "with":
                    All(str, Length(min=1)),
                    "file":
                    All(str, Length(min=1)),
                    "script":
                    All(str, Length(min=1)),
                    "cwd":
                    All(str, Length(min=1)),
                    "path":
                    All(str, Length(min=1)),
                }],
            ),
        },
    })
示例#26
0
文件: recovery.py 项目: b59118/lava
def schema(live=False):
    base = {
        Required("method"): Msg("recovery", "'method' should be 'recovery'"),
        Required("commands"): Any("recovery", "exit"),
    }
    return {**boot.schema(live), **base}
示例#27
0
def schema():
    base = {
        Required("method"): Msg("lxc", "'method' should be 'lxc'"),
        Required("prompts"): boot.prompts(),
    }
    return {**boot.schema(), **base}
示例#28
0
def schema(live=False):
    base = {Required("method"): Msg("cmsis-dap", "'method' should be 'cmsis-dap'")}
    return {**boot.schema(live), **base}
示例#29
0
def schema():
    base = {Required("method"): Msg("jlink", "'method' should be 'jlink'")}
    return {**boot.schema(), **base}
示例#30
0
文件: musca.py 项目: slawr/lava
def schema():
    base = {
        Required("method"): Msg("musca", "'method' should be 'musca'"),
        Optional("prompts"): boot.prompts(),
    }
    return {**boot.schema(), **base}