def assert_cf_work(step, serv_as): time.sleep(180) server = getattr(world, serv_as) cloud = Cloud() cloud_serv = cloud.node_from_server(server) out = cloud_serv.run("/bin/bash -c 'source /usr/local/rvm/scripts/rvm; vmc info'")[0] world.assert_not_in("VMware's Cloud Application Platform", out, 'CF client not work, message: %s' % out)
def add_test_app(step, serv_as): server = getattr(world, serv_as) cloud = Cloud() node = cloud.node_from_server(server) node.run('mkdir env') cont = resources('scripts/env.rb') node.put(path='/root/env/env.rb', content=cont.get()) out = node.run("/bin/bash -c 'source /usr/local/rvm/scripts/rvm; vmc login --email [email protected] --passwd password; echo Y | vmc push testapp --url %s --mem 64 --path /root/env/'" % world.D1)[0] world.assert_not_in('Starting Application: OK', out, 'Application is not starting: %s' % out)
def add_user(step, serv_as): server = getattr(world, serv_as) cloud = Cloud() node = cloud.node_from_server(server) out = node.run("/bin/bash -c 'source /usr/local/rvm/scripts/rvm; vmc register --email [email protected] --passwd password'")[0] world.assert_not_in('Creating New User: OK', out, 'Error in user creation: %s' % out)