def assert_contents_of_env_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d', 'bp_env_vars.sh').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file( build_dir, '.profile.d', 'bp_env_vars.sh').any_line().equals( 'export [email protected]\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, 'start.sh').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, 'start.sh').line(0).equals( 'export PYTHONPATH=$HOME/.bp/lib\n') # noqa .line(-1).equals('$HOME/.bp/bin/start'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d/finalize_rewrite.sh').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file( build_dir, '.profile.d/finalize_rewrite.sh').line(0).contains( 'export PYTHONPATH=$HOME/.bp/lib')) # noqa
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, '.procs').any_line().equals( 'nginx: $HOME/nginx/sbin/nginx -c ' # noqa '"$HOME/nginx/conf/nginx.conf"\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d/finalize_rewrite.sh').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file( build_dir, '.profile.d/finalize_rewrite.sh').any_line().contains( '$HOME/.bp/bin/rewrite "$HOME/httpd/conf"'))
def assert_contents_of_env_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.env').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, '.env').any_line().equals( 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:' '$HOME/hhvm/usr/lib/hhvm\n').equals( 'export PATH=$PATH:$HOME/hhvm/usr/bin\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, 'start.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'start.sh') .any_line() .equals('$HOME/.bp/bin/rewrite "$HOME/nginx/conf"\n'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.procs') .line(0) .equals('php-app: $HOME/php/bin/php -c "$HOME/php/etc" app.php\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d/rewrite.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.profile.d/rewrite.sh') .line(0) .contains('export PYTHONPATH=$HOME/.bp/lib')) # noqa
def assert_contents_of_env_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d', 'bp_env_vars.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.profile.d', 'bp_env_vars.sh') .any_line() .equals('export [email protected]\n'))
def assert_downloads_from_output(self, output): assert output is not None, "Output is None" tfah = TextFileAssertHelper() (tfah.expect().on_string(output).line_count_equals( self.download, lambda l: l.startswith('Downloaded')).line_count_equals( self.install, lambda l: l.startswith('Installing')).line( -1).startswith('Finished:'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, 'start.sh').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, 'start.sh').any_line().equals( '$HOME/.bp/bin/rewrite "$HOME/hhvm/etc"\n').equals( 'hhvm() { $HOME/hhvm/usr/bin/hhvm ' '-c "$HOME/hhvm/etc/php.ini" "$@"; }\n'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, '.procs').any_line().equals( 'httpd: $HOME/httpd/bin/apachectl -f ' # noqa '"$HOME/httpd/conf/httpd.conf" -k start ' '-DFOREGROUND\n'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, '.procs').any_line().equals( 'hhvm: $HOME/hhvm/usr/bin/hhvm --mode server ' # noqa '-c $HOME/hhvm/etc/server.ini ' '-c $HOME/hhvm/etc/php.ini\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d/rewrite.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.profile.d/rewrite.sh') .any_line() .contains('$HOME/.bp/bin/rewrite "$HOME/php/etc"'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, '.procs').any_line().equals( 'php-fpm: $HOME/php/sbin/php-fpm -p ' # noqa '"$HOME/php/etc" -y "$HOME/php/etc/php-fpm.conf"' ' -c "$HOME/php/etc"\n'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.procs') .any_line() .equals('nginx: $HOME/nginx/sbin/nginx -c ' # noqa '"$HOME/nginx/conf/nginx.conf"\n'))
def assert_downloads_from_output(self, output): tfah = TextFileAssertHelper() (tfah.expect() .on_string(output) .line_count_equals(6, lambda l: l.startswith('Downloaded')) .line_count_equals(1, lambda l: l.startswith('No Web')) .line_count_equals(1, lambda l: l.startswith('Installing PHP')) .line_count_equals(1, lambda l: l.find('php-cli') >= 0) .line(-1).startswith('Finished:'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.procs') .any_line() .equals('httpd: $HOME/httpd/bin/apachectl -f ' # noqa '"$HOME/httpd/conf/httpd.conf" -k start ' '-DFOREGROUND\n'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.procs') .any_line() .equals('php-fpm: $HOME/php/sbin/php-fpm -p ' # noqa '"$HOME/php/etc" -y "$HOME/php/etc/php-fpm.conf"' ' -c "$HOME/php/etc"\n'))
def assert_downloads_from_output(self, output): assert output is not None, "Output is None" tfah = TextFileAssertHelper() (tfah.expect() .on_string(output) .line_count_equals(self.download, lambda l: l.startswith('Downloaded')) .line_count_equals(self.install, lambda l: l.startswith('Installing')) .line(-1).startswith('Finished:'))
def assert_contents_of_env_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.env').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, '.env').any_line().equals( 'export ' 'PATH=$PATH:$HOME/php/bin:$HOME/php/sbin\n') # noqa .equals('export ' 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/php/lib\n').equals( 'export PHPRC=$HOME/php/etc\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, 'start.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'start.sh') .line(0) .equals('export PYTHONPATH=$HOME/.bp/lib\n') # noqa .line(-1) .equals('$HOME/.bp/bin/start'))
def assert_contents_of_procs_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.procs').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.procs') .any_line() .equals('hhvm: $HOME/hhvm/usr/bin/hhvm --mode server ' # noqa '-c $HOME/hhvm/etc/server.ini ' '-c $HOME/hhvm/etc/php.ini\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, 'start.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'start.sh') .any_line() .equals('$HOME/.bp/bin/rewrite "$HOME/hhvm/etc"\n') .equals('hhvm() { $HOME/hhvm/usr/bin/hhvm ' '-c "$HOME/hhvm/etc/php.ini" "$@"; }\n'))
def assert_contents_of_env_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d', 'bp_env_vars.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.profile.d', 'bp_env_vars.sh') .any_line() .equals('export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:' '$HOME/hhvm/usr/lib/hhvm\n') .equals('export PATH=$PATH:$HOME/hhvm/usr/bin\n'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect().root(build_dir, 'newrelic') # noqa .path('daemon', 'newrelic-daemon.x64').path('agent', 'x64', 'newrelic-20170718.so').exists()) tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, 'php', 'etc', 'php.ini').any_line( ).startswith('extension=@{HOME}/newrelic/agent/x64/newrelic').equals( '[newrelic]\n').equals('newrelic.license=@{NEWRELIC_LICENSE}\n'). equals('newrelic.appname=app-name-1\n'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect().root(build_dir, 'nginx').path('logs') # noqa .path('sbin', 'nginx').root( build_dir, 'nginx', 'conf').directory_count_equals(10).path( 'fastcgi_params').path('http-logging.conf').path( 'http-defaults.conf').path('http-php.conf').exists()) tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, 'nginx', 'conf', 'http-php.conf').any_line().does_not_contain( '#{PHP_FPM_LISTEN}') # noqa .does_not_contain('{TMPDIR}'))
def assert_contents_of_env_file(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, '.profile.d', 'bp_env_vars.sh').exists() tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, '.profile.d', 'bp_env_vars.sh') .any_line() .equals('export ' 'PATH=$PATH:$HOME/php/bin:$HOME/php/sbin\n') # noqa .equals('export ' 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/php/lib\n') .equals('export PHPRC=$HOME/php/etc\n'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect() .root(build_dir, 'appdynamics') # noqa .path('daemon', 'appdynamics-daemon.x64') .path('agent', 'x64', 'appdynamics-20121212.so') .exists()) tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'php', 'etc', 'php.ini') .any_line() .equals( 'extension=@{HOME}/appdynamics/agent/x64/appdynamics-20121212.so\n') .equals('[appdynamics]\n') .equals('appdynamics.license=JUNK_LICENSE\n') .equals('appdynamics.appname=app-name-1\n'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect() .root(build_dir, 'newrelic') # noqa .path('daemon', 'newrelic-daemon.x64') .path('agent', 'x64', 'newrelic-20100525.so') .exists()) tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'php', 'etc', 'php.ini') .any_line() .equals( 'extension=@{HOME}/newrelic/agent/x64/newrelic-20100525.so\n') .equals('[newrelic]\n') .equals('newrelic.license=JUNK_LICENSE\n') .equals('newrelic.appname=app-name-1\n'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect().root(build_dir, 'codizy', 'client', 'application').path('setup.php') # noqa .path('class', 'Codizy_utils.php').root( build_dir, 'php', 'lib', 'php', 'extensions', 'no-debug-non-zts-20100525', reset=True).path('xhprof.so').path('ioncube.so').path( 'codizy.so').path('curl.so').path('gettext.so').path( 'mbstring.so').path('openssl.so').exists()) tfah = TextFileAssertHelper() (tfah.expect().on_file( build_dir, 'php', 'etc', 'php.ini').any_line().equals( 'auto_prepend_file = ' '@{HOME}/codizy/client/application/setup.php\n'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect() .root(build_dir, 'nginx') .path('logs') # noqa .path('sbin', 'nginx') .root(build_dir, 'nginx', 'conf') .directory_count_equals(10) .path('fastcgi_params') .path('http-logging.conf') .path('http-defaults.conf') .path('http-php.conf') .exists()) tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'nginx', 'conf', 'http-php.conf') .any_line() .does_not_contain('#{PHP_FPM_LISTEN}') # noqa .does_not_contain('{TMPDIR}'))
def assert_files_installed(self, build_dir): fah = FileAssertHelper() (fah.expect() .root(build_dir, 'codizy', 'client', 'application') .path('setup.php') # noqa .path('class', 'Codizy_utils.php') .root(build_dir, 'php', 'lib', 'php', 'extensions', 'no-debug-non-zts-20100525', reset=True) .path('xhprof.so') .path('ioncube.so') .path('codizy.so') .path('curl.so') .path('gettext.so') .path('mbstring.so') .path('openssl.so') .exists()) tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'php', 'etc', 'php.ini') .any_line() .equals('auto_prepend_file = ' '@{HOME}/codizy/client/application/setup.php\n'))
def assert_start_script_is_correct(self, build_dir): fah = FileAssertHelper() fah.expect().path(build_dir, 'start.sh').exists() tfah = TextFileAssertHelper() (tfah.expect().on_file(build_dir, 'start.sh').any_line().equals( '$HOME/.bp/bin/rewrite "$HOME/httpd/conf"\n'))
def assert_server_ini_contains(self, build_dir, expected_listener): tfah = TextFileAssertHelper() (tfah.expect() .on_file(build_dir, 'hhvm', 'etc', 'server.ini') .any_line() .contains(expected_listener))
def assert_server_ini_contains(self, build_dir, expected_listener): tfah = TextFileAssertHelper() (tfah.expect().on_file( build_dir, 'hhvm', 'etc', 'server.ini').any_line().contains(expected_listener))