From 0569efd88040984ac31a77f34f39422e7c639708 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 27 May 2014 14:18:18 -0400 Subject: [PATCH 1/6] Allow specifying the FS package version --- attributes/package.rb | 1 + recipes/package.rb | 2 +- recipes/rayo.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/attributes/package.rb b/attributes/package.rb index 83f1840..1007d00 100644 --- a/attributes/package.rb +++ b/attributes/package.rb @@ -16,6 +16,7 @@ freeswitch-config-vanilla ) end +default['freeswitch']['package']['version'] = nil default['freeswitch']['package']['config_template'] = 'vanilla' default['freeswitch']['package']['repo']['enable'] = true diff --git a/recipes/package.rb b/recipes/package.rb index 971c745..8cf7085 100644 --- a/recipes/package.rb +++ b/recipes/package.rb @@ -12,7 +12,7 @@ end node['freeswitch']['package']['packages'].each do |pkg| - package pkg + package pkg, node['freeswitch']['package']['version'] end directory "/etc/freeswitch" do diff --git a/recipes/rayo.rb b/recipes/rayo.rb index cfa009a..b6d2f3d 100644 --- a/recipes/rayo.rb +++ b/recipes/rayo.rb @@ -24,6 +24,8 @@ freeswitch-config-rayo ) end +node.default['freeswitch']['package']['version'] = nil + node.default['freeswitch']['package']['config_template'] = 'rayo' node.default['freeswitch']['source']['config_template'] = 'rayo' From c10acbf6e55915f9b4c10de096a0669addb02d75 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 27 May 2014 14:23:42 -0400 Subject: [PATCH 2/6] Specify a version for test runs --- .kitchen.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.kitchen.yml b/.kitchen.yml index 0f8bb87..4767d20 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -20,6 +20,7 @@ suites: freeswitch: local_ip: '0.0.0.0' domain: 'foo.bar.com' + version: '1.2.22~2-1~wheezy+1' - name: source run_list: - recipe[freeswitch] From e961c6f867a14f45f4b936bc7b8b926194e071e1 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 27 May 2014 14:40:50 -0400 Subject: [PATCH 3/6] Specify the version the right way --- recipes/package.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/package.rb b/recipes/package.rb index 8cf7085..dc0807d 100644 --- a/recipes/package.rb +++ b/recipes/package.rb @@ -12,7 +12,9 @@ end node['freeswitch']['package']['packages'].each do |pkg| - package pkg, node['freeswitch']['package']['version'] + package pkg do + version node['freeswitch']['package']['version'] + end end directory "/etc/freeswitch" do From 68e50cfbd81f1042bab19e1987ebc152374202ac Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Tue, 27 May 2014 14:50:39 -0400 Subject: [PATCH 4/6] Remove unnecessary default package version --- recipes/rayo.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/rayo.rb b/recipes/rayo.rb index b6d2f3d..cfa009a 100644 --- a/recipes/rayo.rb +++ b/recipes/rayo.rb @@ -24,8 +24,6 @@ freeswitch-config-rayo ) end -node.default['freeswitch']['package']['version'] = nil - node.default['freeswitch']['package']['config_template'] = 'rayo' node.default['freeswitch']['source']['config_template'] = 'rayo' From c6b8ccf17c15fcb500de3a8ef345fac728164f58 Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Tue, 27 May 2014 16:00:52 -0300 Subject: [PATCH 5/6] Specify version constraint in the correct place --- .kitchen.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.kitchen.yml b/.kitchen.yml index 4767d20..7f90c70 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -20,7 +20,8 @@ suites: freeswitch: local_ip: '0.0.0.0' domain: 'foo.bar.com' - version: '1.2.22~2-1~wheezy+1' + package: + version: '1.2.22~2-1~wheezy+1' - name: source run_list: - recipe[freeswitch] From c810df2c19531ed205075fd5ed1f7038c9d41330 Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Tue, 27 May 2014 16:01:29 -0300 Subject: [PATCH 6/6] We're expecting a specific version --- .../integration/package/serverspec/localhost/freeswitch_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/package/serverspec/localhost/freeswitch_spec.rb b/test/integration/package/serverspec/localhost/freeswitch_spec.rb index f9dc536..f4fc65f 100644 --- a/test/integration/package/serverspec/localhost/freeswitch_spec.rb +++ b/test/integration/package/serverspec/localhost/freeswitch_spec.rb @@ -24,7 +24,7 @@ end describe command('fs_cli -x "version"') do - it { should return_stdout /FreeSWITCH Version 1.2/ } + it { should return_stdout /FreeSWITCH Version 1.2.22/ } end describe port(5060) do