/aet-cookbook

Primary LanguageRubyApache License 2.0Apache-2.0

AET Cookbook

This cookbook prepare virtual machine for Automated Exploratory Tests (AET).

It may be used to quickly create platform for AET demo or to setup an environment for AET development. Required artifacts are downloaded by this cookbook from AET GitHub releases page.

Supported Platforms

Because this cookbook is used for demo instances or development platforms we are not supporting a wide range of platforms. CentOS release 6.7 (Final) is supported currently.

Usage

For demo instance default recipe should be used. For development purpose use aet::_develop and aet::default recipes. The aet::_develop recipe provides additional user used by Maven to upload AET artifacts.

Preparing virtual machine

Include aet in your node's run_list:

{
  "run_list": [
    "recipe[aet::_develop]",
    "recipe[aet::default]"
  ]
}

Using AET

After you have AET instance up and running you could prepare a Maven project to run AET tests. Please refer to the AET documentation on how to setup a test suite.

AET Components

The cookbook installs following components required by AET:

Those components may be installed on separate machines provided they have been configured to work with each other. The configuration is done within Karaf Web Console.

Validation of AET components

  • Karaf - Karaf Web Console should be available at http://192.168.123.100:8181/system/console/bundles. Default credentials: karaf/karaf.
  • Active MQ - Active MQ Web Console should be available at http://192.168.123.100:8161 Default credentials: admin/admin.
  • Mongo DB - curl -I 192.168.123.100:27017 responding with Empty response means that Mongo is listening on default port.
  • Apache HTTP Server - could be checked with curl -I 192.168.123.100
  • Tomcat - could be checked with curl -I 192.168.123.100:9090
  • Browsermob - try curl -I 192.168.123.100:8080. Expected response is:
HTTP/1.1 404 Not Found
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 1267
Server: Jetty(7.3.0.v20110203)

Recipes

Recipes below are presented in groups. Each group (except common) should be installed on same system.

Common

  • java::default - Uses JAVA cookbook. Installs JAVA JDK required by other AET components. Please notice that Karaf for AET works with JAVA ver. 1.7 only.

Active MQ

Recipes:

  • aet::activemq - creates dedicated user (configured with node['aet']['activemq']['user'] and node['aet']['activemq']['group']), downloads and install binary distribution of Active MQ (using binary package from node['aet']['activemq']['source']). Registers Active MQ as a service (/etc/init.d/activemq).

Apache and AET report web application

Recipes:

  • aet::apache - Uses Apache cookbook. Installs Apache HTTP server. Additionally creates a folder (node['aet']['apache']['log_dir']) for apache logs and creates a link from /var/log/httpd to that folder. Enables proxy, proxy_http and headers modules. If aet::_develop recipe is used, then apache service is run with develop system user.
  • aet::deploy_reports - checks if node['aet']['version'] is currently linked as current folder. If no then downloads that version of AET reports web application and extract it into node['aet']['apache']['report_base_dir']/aet_reports/#{ver}. Creates a link from node['aet']['apache']['report_base_dir']/aet_reports/current to the version folder. Setup virtual host for serving a content from the current folder. If aet::_develop recipe is used this is done with develop user.

Karaf, Browsermob, XVFB and Firefox

Recipes:

  • aet::karaf - Creates dedicated system user for Karaf service. If aet::_develop recipe is used, then this user is overwritten by develop user. Downloads Karaf and extracts it into node['aet']['karaf']['root_dir']. Creates a symbolic link from node['aet']['karaf']['root_dir']/current to extracted Karaf instance. Updates karaf OSGi version to org.apache.felix.framework-4.2.1.jar. Sets the JAVA settings for Karaf (updated OSGi version in config.properties file, Web Console credentials in users.properties file, HTTP port in org.ops4j.pax.wweb.cfg file). Creates symbolic link from Karaf log dir to node['aet']['karaf']['log_dir']. Registers Karaf as a service (/etc/init.d/karaf) and starts it.
  • aet::deploy_bundles - Check if node['aet']['karaf']['root_dir']/current/deploy/bundles is a link to current version (node['aet']['version']). If not, then downloads bundles, extracts them to the node['aet']['karaf']['root_dir']/aet_bundles/#{ver} folder, creates link to that folder from node['aet']['karaf']['root_dir']/current/deploy/bundles and schedules Karaf restart. If aet::_develop recipe is used this is done with develop user.
  • aet::deploy_configs - Similar to aet::deploy_bundles
  • aet::deploy_features - Similar to aet::deploy_bundles
  • aet::postdeploy_restart - Check if karaf restart was scheduled (if /tmp/karaf-restart file exists). If so, then stops Karaf service, deletes Karaf cache folders and starts Karaf again.
  • aet::browsermob - Creates dedicated user for Browsermob service. Installs Browsermob into node['aet']['browsermob']['root_dir']. Registers it as a service (/etc/init.d/browsermob) and starts it.
  • aet::firefox - Creates dedicated user for firefox folders permissions. Downloads (from node['aet']['firefox']['source']) and installs Firefox browser. Configures Firefox to use virtual display from XVFB.
  • aet::xvfb - Creates dedicated user for xvfb. Installs XVFB service and configures it to use node['aet']['xvfb']['log_dir'] as log dir. The resolution for virtual screen may be set by node['aet']['xvfb']['resolution']. The default value is '1280x1024x24'.

Tomcat and Sample Site

Recipes:

  • aet::tomcat - Creates dedicated user for Tomcat service. If aet::_develop recipe is used, then this user is overwritten by develop user. Downloads tomcat and installs it into node['aet']['tomcat']['base_dir']. Configures JAVA settings, tomcat port and tomcat users. Registers tomcat as a service (/etc/init.d/tomcat) and enables it.
  • aet::deploy_sample_site - Checks if node['aet']['karaf']['root_dir']/tomcat/aet_sample_site/current is a link to current version (node['aet']['version']) of sample site. If not, then downloads required version, extracts it to node['aet']['karaf']['root_dir']/tomcat/aet_sample_site/#{ver}, creates a link from current to this version and restarts tomcat. If aet::_develop recipe is used this is done with develop user.

_develop recipe

  • aet::_develop - Please note that this recipe is not included by default. If included it will override system users for Tomcat, Karaf and Apache with develop user. This has been done in order to enable uploads of AET artifacts to these services.

Mongo DB

Recipes:

X Window

Recipes:

  • aet::display - Installs X Window for the convenience of virtual machine users.
  • aet::reboot - After X Window is installed the system needs one reboot. This cookbook schedules reboot of virtual machine. The reboot is done only once.

Attributes

See attributes/ folder for default values.

  • node['aet']['version'] - version of AET to set-up. Used by deploy recipes. (default: '1.3.2-test')
  • node['aet']['base_link'] - base link for AET release artifacts. (default: 'https://github.com/Cognifide/AET/releases/download')
  • node['aet']['activemq']['root_dir'] - parent folder for Active MQ installation (default: '/opt/aet/activemq')
  • node['aet']['activemq']['log_dir'] - log dir for Active MQ (default: '/var/log/activemq')
  • node['aet']['activemq']['user'] - system user for Active MQ service (default: 'activemq')
  • node['aet']['activemq']['group'] - system group for Active MQ service (default: 'activemq')
  • node['aet']['activemq']['login'] - login for Active MQ Web Console (default: 'admin')
  • node['aet']['activemq']['password'] - password for Active MQ Web Console (default: 'admin')
  • node['aet']['activemq']['java_min_mem'] - min heap for Active MQ (default: '64M')
  • node['aet']['activemq']['java_max_mem'] - max heap for Active MQ (default: '1024M')
  • node['aet']['activemq']['java_min_perm_mem'] - min permanent space for Active MQ (default: '64M')
  • node['aet']['activemq']['java_max_perm_mem'] - max permanent space for Active MQ (default: '128M')
  • node['aet']['activemq']['jmx_port'] - port to use by Active MQ (default: '11199')
  • node['aet']['activemq']['jmx_ip'] - IP for Active MQ JMX (default: node['ipaddress'])
  • node['aet']['activemq']['enable_debug'] - enables JAVA debug agent on port 5006 (default: false)
  • node['aet']['apache']['report_base_dir'] - folder for AET reports web application (default: '/opt/aet/apache')
  • node['aet']['apache']['log_dir'] - apache logs folder (will be linked from /var/log/httpd) (default: '/var/log/apache')
  • node['aet']['browsermob']['root_dir'] - parent folder for Browsermob installation (default: '/opt/aet/browsermob')
  • node['aet']['browsermob']['log_dir'] - Browsermob logs folder (default: '/var/log/browsermob')
  • node['aet']['browsermob']['user'] - system user for Browsermob service (default: 'browsermob')
  • node['aet']['browsermob']['group'] - system group for Browsermob service (default: 'browsermob')
  • node['aet']['browsermob']['port'] - port for Browsermob proxy (default: '8080')
  • node['aet']['firefox']['root_dir'] - parent folder for Firefox browser installation (default: '/opt/aet/firefox')
  • node['aet']['karaf']['user'] - system user for Karaf service (default: 'karaf')
  • node['aet']['karaf']['group'] - system group for Karaf service (default: 'karaf')
  • node['aet']['karaf']['ssh_password'] - [hashed password][#hashed-passwords] for develop user
  • node['aet']['karaf']['login'] - login for Karaf instance (WebConsole, SSH) (default: 'karaf')
  • node['aet']['karaf']['password'] - password for Karaf instance (WebConsole, SSH) (default: 'karaf')
  • node['aet']['karaf']['root_dir'] - parent folder for Karaf installation (default: '/opt/aet/karaf')
  • node['aet']['karaf']['log_dir'] - log dir for Karaf (default: '/var/log/karaf')
  • node['aet']['karaf']['enable_debug'] - enables JAVA debug agent on port 5005 (default: false)
  • node['aet']['karaf']['web_port'] - HTTP port for Karaf (default: '8181')
  • node['aet']['karaf']['ssh_port'] - SSH port for Karaf (default: '8101')
  • node['aet']['karaf']['java_min_mem'] - min heap for Karaf (default: '512M')
  • node['aet']['karaf']['java_max_mem'] - max heap for Karaf (default: '1024M')
  • node['aet']['karaf']['java_min_perm_mem'] - min permanent space for Karaf (default: '64M')
  • node['aet']['karaf']['java_max_perm_mem'] - max permanent space for Karaf (default: '128M')
  • node['aet']['tomcat']['base_dir'] - parent folder for Tomcat installation (default: '/opt/aet/tomcat')
  • node['aet']['tomcat']['log_dir'] - log dir for Tomcat (default: '/var/log/tomcat')
  • node['aet']['tomcat']['user'] - system user for Tomcat service (default: 'tomcat')
  • node['aet']['tomcat']['group'] - system group for Tomcat service (default: 'tomcat')
  • node['aet']['tomcat']['debug_enabled'] - enables JAVA debug agent on port (default: false)
  • node['aet']['tomcat']['debug_port'] - default value is '29090'
  • node['aet']['tomcat']['jmx_enabled'] - enables JMX for Tomcat (default: true)
  • node['aet']['tomcat']['jmx_port'] - default value is '19090'
  • node['aet']['tomcat']['port'] - default value is '9090' (as 8080 is used by Browsermob)
  • node['aet']['tomcat']['min_heap'] - min heap for Tomcat (default: '256')
  • node['aet']['tomcat']['max_heap'] - max heap for Tomcat (default: '512')
  • node['aet']['tomcat']['max_permsize'] - max permanent space for Tomcat (default: '256')
  • node['aet']['tomcat']['connector']['maxswallowsize'] - for Tomcat maxSwallowSize (default: '2097152')
  • node['aet']['tomcat']['login'] - login for Tomcat instance (i.e. Manager app) (default: 'admin')
  • node['aet']['tomcat']['password'] - password for Tomcat instance (i.e. Manager app) (default: 'admin')
  • node['aet']['xvfb']['user'] - system user for XVFB (default: 'xvfb')
  • node['aet']['xvfb']['group'] - system group for XVFB (default: 'xvfb')
  • node['aet']['xvfb']['log_dir'] - log dir for XVFB (default: '/var/log/xvfb')
  • node['aet']['xvfb']['resolution'] - resolution for XVFB (default: '1280x1024x24')
  • node['aet']['develop']['user'] - user for develop instance
  • node['aet']['develop']['group'] - group for develop instance
  • node['aet']['develop']['ssh_password'] - hashed password for develop user (generated with openssl passwd -1 "password")

Hashed passwords

In order to generate hashed password for an user please use following command:

[vagrant@aet-vagrant ~]$ openssl passwd -1 "password"
$1$WxkKLOya$9ZOsQs7YdfjZB1wsaJPkW0
[vagrant@aet-vagrant ~]$

New cookbook version

Deployment of new versions of this cookbook is managed with Stove. Chef Supermarket login and key is required for new version deployment.

License and Authors

Authors:

License: Apache License, Version 2.0