File tree 1 file changed +7
-16
lines changed
1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change 3
3
require 'spec_helper_acceptance'
4
4
5
5
tmpdir = '/tmp/vcsrepo'
6
+ homedir = '/root/' #set as /root/ for acceptance testing on containers
6
7
7
8
describe 'clones a remote repo' do
8
9
before ( :all ) do
470
471
471
472
context 'with using an identity file' do
472
473
before ( :all ) do
473
- # create user
474
- pp = <<-MANIFEST
475
- user { 'testuser-ssh':
476
- ensure => present,
477
- managehome => true,
478
- }
479
- MANIFEST
480
- apply_manifest ( pp , catch_failures : true )
481
-
482
474
# create ssh keys
483
- run_shell ( ' mkdir -p /home/testuser-ssh/ .ssh' )
484
- run_shell ( ' ssh-keygen -q -t rsa -f /home/testuser-ssh/ .ssh/id_rsa -N ""' )
475
+ run_shell ( " mkdir -p #{ homedir } / .ssh" )
476
+ run_shell ( " ssh-keygen -q -t rsa -f #{ homedir } / .ssh/id_rsa -N ''" )
485
477
486
478
# copy public key to authorized_keys
487
- run_shell ( 'cat /home/testuser-ssh/.ssh/id_rsa.pub > /home/testuser-ssh/.ssh/authorized_keys' )
488
- run_shell ( 'echo -e "Host localhost\n\tStrictHostKeyChecking no\n" > /home/testuser-ssh/.ssh/config' )
489
- run_shell ( 'chown -R testuser-ssh:testuser-ssh /home/testuser-ssh/.ssh' )
479
+ run_shell ( "cat #{ homedir } /.ssh/id_rsa.pub > #{ homedir } /.ssh/authorized_keys" )
480
+ run_shell ( "echo -e \" Host localhost\\ n\\ tStrictHostKeyChecking no\\ n\" > #{ homedir } /.ssh/config" )
490
481
end
491
482
492
483
pp = <<-MANIFEST
493
484
vcsrepo { "#{ tmpdir } /testrepo_user_ssh_id":
494
485
ensure => present,
495
486
provider => git,
496
- source => "testuser-ssh @localhost:#{ tmpdir } /testrepo.git",
497
- identity => '/home/testuser-ssh /.ssh/id_rsa',
487
+ source => "root @localhost:#{ tmpdir } /testrepo.git",
488
+ identity => '#{ homedir } /.ssh/id_rsa',
498
489
}
499
490
MANIFEST
500
491
it 'applies the manifest' do
You can’t perform that action at this time.
0 commit comments