Merge branch 'bobthe' of ssh://bitbucket.org/yackob03/quay into bobthe

This commit is contained in:
yackob03 2014-02-11 12:10:09 -05:00
commit dc1737e0da
11 changed files with 623 additions and 55 deletions

View file

@ -5,6 +5,7 @@ from random import SystemRandom
from loremipsum import get_sentence
from data.buildlogs import BuildLogs
from random import choice
logger = logging.getLogger(__name__)
@ -26,10 +27,22 @@ class TestBuildLogs(BuildLogs):
self._generate_logs()
self._status = {}
def _get_random_command(self):
COMMANDS = ['FROM', 'MAINTAINER', 'RUN', 'CMD', 'EXPOSE', 'ENV', 'ADD',
'ENTRYPOINT', 'VOLUME', 'USER', 'WORKDIR']
return choice(COMMANDS)
def _generate_command(self):
self.last_command += 1
sentence = get_sentence()
command = self._get_random_command()
if command == 'FROM':
sentence = choice(['ubuntu', 'quay.io/devtable/simple', 'quay.io/buynlarge/orgrepo', 'stackbrew/ubuntu:precise'])
return {
'message': 'Step %s : %s' % (self.last_command, get_sentence()),
'message': 'Step %s: %s %s' % (self.last_command, command, sentence),
'is_command': True,
}