test-kitchenを並列実行する
タイトル通りのちょっとしたメモです。
test-kitchenを並列実行したいときは、-p(--parallel)オプションをつけると並列でレシピの適用を行えます。
$ kitchen help converge Usage: kitchen converge [INSTANCE|REGEXP|all] Options: -c, [--concurrency=N] # Run a converge against all matching instances concurrently. Only N instances will run at the same time if a number is given. -p, [--parallel], [--no-parallel] # [Future DEPRECATION, use --concurrency] Run a converge against all matching instances concurrently. -l, [--log-level=LOG_LEVEL] # Set the log level (debug, info, warn, error, fatal) Description: The instance states are in order: destroy, create, converge, setup, verify, destroy. Change one or more instances from the current state to the converge state. Actions for all intermediate states will be executed. See http://kitchen.ci for further explanation.
以下は実行してみた例です。
# kitchen converge -c 2 -p -----> Starting Kitchen (v1.2.2.dev) -----> Converging <centos5-32-base-centos>... Preparing files for transfer Resolving cookbook dependencies with Berkshelf 3.1.3... -----> Converging <centos5-64-base-centos>... Preparing files for transfer Resolving cookbook dependencies with Berkshelf 3.1.3... Removing non-cookbook files before transfer Preparing data bags Preparing environments Preparing nodes Preparing roles -----> Installing Chef Omnibus (11.16.4) downloading https://www.getchef.com/chef/install.sh to file /tmp/install.sh trying wget... trying curl... curl: (51) SSL: certificate subject name '*.chef.io' does not match target host name 'www.getchef.com' trying perl... A URI can't be a ARRAY reference at /usr/lib/perl5/vendor_perl/5.8.8/LWP/Simple.pm line 94 trying python... Downloading Chef 11.16.4 for el... downloading https://www.chef.io/chef/metadata?v=11.16.4&prerelease=false&nightlies=false&p=el&pv=5&m=i686 to file /tmp/install.sh.4791/metadata.txt trying wget... url https://opscode-omnibus-packages.s3.amazonaws.com/el/5/i686/chef-11.16.4-1.el5.i686.rpm md5 b83a4dd153f65ef771af50f082951cae sha256 733508a72f16d998d6713a72b514e439f473fb1da5a7593b7c340a0c09cad4ef downloaded metadata file looks valid... downloading https://opscode-omnibus-packages.s3.amazonaws.com/el/5/i686/chef-11.16.4-1.el5.i686.rpm to file /tmp/install.sh.4791/chef-11.16.4-1.el5.i686.rpm trying wget... Removing non-cookbook files before transfer Preparing data bags Preparing environments Preparing nodes Preparing roles -----> Installing Chef Omnibus (11.16.4) downloading https://www.getchef.com/chef/install.sh
今日はこんなところで。
参考
- [What means the opts attribute in Test-Kitchen commands?:title=http://stackoverflow.com/questions/22178777/what-means-the-opts-attribute-in-test-kitchen-commands]