Skip to content

Commit

Permalink
tests: improve ansible pkg installation
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jan 28, 2025
1 parent eb29698 commit 6c79815
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions t/scenarios/_common/ansible/roles/local_tests/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
creates:
- /usr/bin/unbuffer
- /usr/bin/diff
- /usr/share/doc/perl-Test-Harness
- /usr/share/doc/perl-ExtUtils-Manifest
- /usr/share/doc/perl-ExtUtils-Install
- /usr/share/perl5/vendor_perl/Test/Harness.pm
- /usr/share/perl5/vendor_perl/ExtUtils/Manifest.pm
- "/usr/share/perl5/vendor_perl/ExtUtils/Install.pm,/usr/share/perl5/ExtUtils/Install.pm"
- lineinfile:
path: /etc/locale.conf
regexp: '^LANG='
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
- perl-File-Which
- perl-IPC-Cmd
creates:
- /usr/share/doc/perl-ExtUtils-Manifest
- /usr/share/doc/perl-ExtUtils-Install
- /usr/share/doc/perl-File-Which
- /usr/share/doc/perl-IPC-Cmd
- /usr/share/perl5/vendor_perl/ExtUtils/Manifest.pm
- "/usr/share/perl5/vendor_perl/ExtUtils/Install.pm,/usr/share/perl5/ExtUtils/Install.pm"
- /usr/share/perl5/vendor_perl/File/Which.pm
- /usr/share/perl5/vendor_perl/IPC/Cmd.pm

- name: "install Monitoring::Generator::TestConfig"
shell: "sudo su - {{ site }} -c 'cpanm -n Monitoring::Generator::TestConfig'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
package:
- make
creates:
- /usr/share/doc/perl-ExtUtils-Manifest
- /usr/share/doc/perl-ExtUtils-Install
- /usr/share/perl5/vendor_perl/ExtUtils/Manifest.pm
- "/usr/share/perl5/vendor_perl/ExtUtils/Install.pm,/usr/share/perl5/ExtUtils/Install.pm"
- /usr/bin/git
- /usr/bin/make

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if [ "{{ creates | join(' ') }}" != "" ]; then
allfound=1
for file in {{ creates | join(' ') }}; do
if ! test -e $file; then
if [ $(ls -l1 $(echo $file | tr , ' ') 2>/dev/null | wc -l) -eq 0 ]; then
allfound=0
fi
done
Expand All @@ -18,7 +18,7 @@
yum install -y {{ package | join(' ') }} {{ rpm | join(' ') }}
fi
for file in {{ creates | join(' ') }}; do
if ! test -e $file; then
if [ $(ls -l1 $(echo $file | tr , ' ') 2>/dev/null | wc -l) -eq 0 ]; then
echo "file $file not found after pkg installation"
exit 1
fi
Expand Down

0 comments on commit 6c79815

Please sign in to comment.