Exemple #1
0
def get_shell_commands(shell_command_line):
    '''Given a shell command line, get a list of Command objects'''
    comm_list = general.split_command(shell_command_line)
    cleaned_list = []
    for comm in comm_list:
        cleaned_list.append(Command(general.clean_command(comm)))
    return cleaned_list
Exemple #2
0
def get_shell_commands(shell_command_line):
    '''Given a shell command line, get a list of Command objects'''
    comm_list = shell_command_line.split('&&')
    cleaned_list = []
    for comm in comm_list:
        cleaned_list.append(Command(comm.strip()))
    return cleaned_list
Exemple #3
0
 def setUp(self):
     self.install = Command('apt-get install -y git')
     self.untar = Command('tar -x -C file tarfile.tar')
     self.download = Command('wget url')
     self.remove = Command('apt-get purge git')
     self.install2 = Command('apt-get install -y ca-certificates')
     self.pinned1 = Command('apt-get install python3 zlib1g-dev=4.52.1')
     self.pinned2 = Command('apt-get install ca-certificates:ppc64=2018i')
     self.pinned3 = Command('yum install libncurses5-dev syslog-ng-1-2.3')
Exemple #4
0
def get_shell_commands(shell_command_line):
    '''Given a shell command line, get a list of Command objects and report on
    branch statements'''
    statements = general.split_command(shell_command_line)
    command_list = []
    branch_report = ''
    # traverse the statements, pick out the loop and commands.
    for stat in statements:
        if 'command' in stat:
            command_list.append(Command(stat['command']))
        elif 'loop' in stat:
            loop_stat = stat['loop']['loop_statements']
            for st in loop_stat:
                if 'command' in st:
                    command_list.append(Command(st['command']))
        elif 'branch' in stat:
            branch_report = branch_report + '\n'.join(stat['content']) + '\n\n'
    if branch_report:
        # add prefix
        branch_report = '\nNon-deterministic branching statement: \n' + \
                        branch_report
    return command_list, branch_report
Exemple #5
0
 def setUp(self):
     self.command1 = Command("yum install nfs-utils")
     self.command2 = Command("yum remove nfs-utils")
Exemple #6
0
 def setUp(self):
     self.command1 = Command("yum install nfs-utils")
     self.image = TestImage('5678efgh')
     cache.cache = {}
     self.test_dockerfile = 'tests/dockerfiles/buildpack_deps_jessie_curl'
Exemple #7
0
 def setUp(self):
     self.install = Command('apt-get install -y git')
     self.untar = Command('tar -x -C file tarfile.tar')
     self.download = Command('wget url')
     self.remove = Command('apt-get purge git')
     self.install2 = Command('apt-get install -y ca-certificates')
Exemple #8
0
 def setUp(self):
     self.command1 = Command("yum install nfs-utils")
     self.command2 = Command("yum remove nfs-utils")
     self.image = TestImage('5678efgh')
     self.file = FileData('README.txt', '/home/test')
     cache.cache = {}
Exemple #9
0
 def setUp(self):
     self.command1 = Command("yum install nfs-utils")
     self.command2 = Command("yum remove nfs-utils")
     self.image = TestImage('5678efgh')