-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Inspec Profile: `default` | ||
|
||
Test git formulas | ||
|
||
## Test Cases | ||
|
||
- [system git configuration](./controls/system_conf.rb) | ||
- [user git configuration](./controls/user_conf.rb) | ||
- [repo cloned and updated by git](./controls/repo.rb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
control "Repo #{os.name}" do | ||
title 'Test git repos' | ||
|
||
dirs = ["/home/vagrant/container", "/home/vagrant/cib"] | ||
dirs.each do | dir | | ||
describe directory(dir) do | ||
it { should exist } | ||
end | ||
describe directory(dir + '/.git') do | ||
it { should exist } | ||
end | ||
end | ||
|
||
describe file('/home/vagrant/cib/VERSION') do | ||
its('content') { should eq "1.0.4\n" } | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
control "Global conf #{os.name}" do | ||
title 'Test global conf' | ||
|
||
describe file('/etc/gitconfig') do | ||
it { should be_file } | ||
end | ||
|
||
describe command('git config --get alias.st') do | ||
its('exit_status') { should eq 0 } | ||
its('stdout') { should eq "status\n" } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
control "User conf #{os.name}" do | ||
title 'Test user conf' | ||
|
||
describe command('git config --get user.email') do | ||
its('exit_status') { should eq 0 } | ||
its('stdout') { should eq "[email protected]\n" } | ||
end | ||
describe command('git config --get user.name') do | ||
its('exit_status') { should eq 0 } | ||
its('stdout') { should eq "Gino Naumann\n" } | ||
end | ||
describe command('git -C /home/vagrant/cib config --get user.name') do | ||
its('exit_status') { should eq 0 } | ||
its('stdout') { should eq "Rainer Zufall\n" } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: default | ||
title: git formula | ||
maintainer: Gino Naumann | ||
version: 0.0.0 | ||
licence: Apache-2.0 | ||
summary: Verify that the git state manages git correctly | ||
supports: | ||
- platform-name: ubuntu | ||
- platform-name: debian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
git: | ||
repo: | ||
container: | ||
name: https://gitlab.com/genaumann/containerpub | ||
target: /home/vagrant/container | ||
cib: | ||
name: https://gitlab.com/genaumann/cib | ||
state: latest | ||
rev: v1.0.4 | ||
user: vagrant | ||
target: /home/vagrant/cib | ||
php: | ||
name: https://github.com/php/php-src | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
git: | ||
system_config: | ||
alias: | ||
st: status | ||
fe: fetch | ||
pu: push | ||
init: | ||
defaultbranch: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
git: | ||
user_config: | ||
- key: user.email | ||
value: [email protected] | ||
user: vagrant | ||
- key: user.name | ||
value: Gino Naumann | ||
user: vagrant | ||
- key: user.name | ||
value: Rainer Zufall | ||
repo: /home/vagrant/cib | ||
user: vagrant | ||
- key: 'remote\..+' | ||
state: absent | ||
repo: /home/vagrant/container | ||
user: vagrant |