@@ -68,8 +68,6 @@ class { \"java\" : }
6868 aem::instance { \" publish\" :
6969 source => \" /tmp/aem-quickstart.jar\" ,
7070 home => \" /opt/aem/publish\" ,
71- user => \" aem\" ,
72- group => \" aem\" ,
7371 manage_home => false,
7472 manage_user => false,
7573 manage_group => false,
@@ -88,6 +86,26 @@ class { \"java\" : }
8886 file { \" /opt/aem/publish\" :
8987 ensure => \" directory\" ,
9088 }
89+
90+ Aem::License {
91+ customer => \" Vagrant Test\" ,
92+ license_key => \" fake-key-for-testing\" ,
93+ version => \" 6.1.0\" ,
94+ }
95+
96+ aem::license { \" author\" :
97+ group => \" vagrant\" ,
98+ user => \" vagrant\" ,
99+ home => \" /opt/aem/author\" ,
100+ }
101+
102+ aem::license { \" publish\" :
103+ home => \" /opt/aem/publish\" ,
104+ }
105+
106+ Aem::Instance[\" author\" ] -> Aem::License[\" author\" ]
107+ Aem::Instance[\" publish\" ] -> Aem::License[\" publish\" ]
108+
91109}'
92110
93111 MANIFEST
@@ -193,6 +211,62 @@ class { \"java\" : }
193211 end
194212 end
195213
214+ context 'license' do
215+ context 'author' do
216+ it 'should have license file' do
217+ shell ( "test -f /opt/aem/publish/license.properties" , :acceptable_exit_codes => 0 )
218+ end
219+
220+ it 'should have correct owner:group' do
221+ shell ( 'stat -c "%U:%G" /opt/aem/author/license.properties' ) do |result |
222+ expect ( result . stdout ) . to match ( 'vagrant:vagrant' )
223+ end
224+ end
225+
226+ it 'should contain customer' do
227+ shell ( 'grep "license.customer.name=Vagrant Test" /opt/aem/author/license.properties' ,
228+ :acceptable_exit_codes => 0 )
229+ end
230+
231+ it 'should contain licnese_key' do
232+ shell ( 'grep "license.downloadID=fake-key-for-testing" /opt/aem/author/license.properties' ,
233+ :acceptable_exit_codes => 0 )
234+ end
235+
236+ it 'should contain version' do
237+ shell ( 'grep "license.product.version=6.1.0" /opt/aem/publish/license.properties' ,
238+ :acceptable_exit_codes => 0 )
239+ end
240+ end
241+
242+ context 'publish' do
243+ it 'should have license file' do
244+ shell ( "test -f /opt/aem/publish/license.properties" , :acceptable_exit_codes => 0 )
245+ end
246+
247+ it 'should have correct owner:group' do
248+ shell ( 'stat -c "%U:%G" /opt/aem/publish/license.properties' ) do |result |
249+ expect ( result . stdout ) . to match ( 'aem:aem' )
250+ end
251+ end
252+
253+ it 'should contain customer' do
254+ shell ( 'grep "license.customer.name=Vagrant Test" /opt/aem/publish/license.properties' ,
255+ :acceptable_exit_codes => 0 )
256+ end
257+
258+ it 'should contain licnese_key' do
259+ shell ( 'grep "license.downloadID=fake-key-for-testing" /opt/aem/publish/license.properties' ,
260+ :acceptable_exit_codes => 0 )
261+ end
262+
263+ it 'should contain version' do
264+ shell ( 'grep "license.product.version=6.1.0" /opt/aem/publish/license.properties' ,
265+ :acceptable_exit_codes => 0 )
266+ end
267+ end
268+ end
269+
196270 context 'running instances' do
197271 it 'should start author with correct port and context root' do
198272 shell ( 'sudo -u vagrant -g vagrant /opt/aem/author/crx-quickstart/bin/start' )
0 commit comments