Exemplo n.º 1
0
    def shell(self, node, timeout=120):
        """Returns unique shell terminal to be used.
        """
        if node is None:
            return Shell()

        shell = Shell(command=[
                "/bin/bash", "--noediting", "-c", f"{self.docker_compose} exec {node} bash --noediting"
            ], name=node)

        shell.timeout = timeout
        return shell
Exemplo n.º 2
0
import os
import time

from testflows.core import *
from testflows.asserts import error
from testflows.connect import Shell

import e2e.settings as settings
import e2e.yaml_manifest as yaml_manifest
import e2e.util as util

current_dir = os.path.dirname(os.path.abspath(__file__))
max_retries = 20

shell = Shell()
shell.timeout = 300
namespace = settings.test_namespace
kubectl_cmd = settings.kubectl_cmd


def launch(command, ok_to_fail=False, ns=namespace, timeout=600):
    # Build command
    cmd = f"{kubectl_cmd} "
    cmd_args = command.split(" ")
    if ns is not None and ns != "" and ns != "--all-namespaces":
        cmd += f"{cmd_args[0]} --namespace={ns} "
    elif ns == "--all-namespaces":
        cmd += f"{cmd_args[0]} {ns} "
    else:
        cmd += f"{cmd_args[0]} "