Поддержка #1465

Пакетирование serverspec

Добавил(а) Йозеф Вирек больше 2 лет назад. Обновлено больше 2 лет назад.

Статус:Поиск мейнтейнераНачата:01.08.2015
Приоритет:НизкийДата выполнения:
Назначена:-Готовность:

0%

Категория:Система
Версия:rawhide
Теги:


Описание

Serverspec — это специальный фреймворк для тестирования инфраструктуры.

http://serverspec.org/
С его помощью проверяется конечное состояние виртуальной машины или сервера. Написан на Ruby и является расширением RSpec, поддерживает все популярные BSD и Linux дистрибутивы, а также Windows. Serverspec содержит в себе около 40 встроенных ресурсов, с помощью которых можно проверить, что пакет в системе установлен, в конфиге указаны нужные параметры, сервис запущен или слушает порт. Если этого недостаточно, то можно вызвать любую shell команду и проверить её вывод. Serverspec отличная альтернатива shell скриптам и позволяет выполнять проверки как локально, так и удалённо. Serverspec активно используется в community инфраструктурном коде, а недавно Chef анонсировали поддержку Serverspec и в рецептах.
https://www.chef.io/blog/2015/05/06/chef-audit-mode-introduction/

История

#1 Обновлено Vasiliy Glazov больше 2 лет назад

  • Параметр Статус изменился с Новая на Поиск мейнтейнера

Готовые сборки уже где-нибудь есть?

#3 Обновлено Igor Gnatenko больше 2 лет назад

  • Параметр Начата изменился с 31.07.2015 на 01.08.2015
  • Параметр Версия изменился на rawhide
  • Параметр Приоритет изменился с Нормальный на Низкий
  • Параметр Назначена изменился на Igor Gnatenko
  • Параметр Категория изменился на Система
  • Параметр Проект изменился с Пожелания на Fedora (Upstream)
  • Параметр Трекер изменился с Изменение на Поддержка

#4 Обновлено Igor Gnatenko больше 2 лет назад

  • Значение Igor Gnatenko параметра Назначена удалено

Начал я опакечивать это барахло. Запакетил rubygem-serverspec, за ним rubygem-specinfra. Тесты не проходят. Мэиллистов у них нет, на гитхабе баги создавать нельзя (прям какая-то без-багованная вундервафля). Пошли они нафиг с таким отношением!

Failures:

1) Specinfra::Backend::Exec#build_command with simple command should escape spaces
Failure/Error: expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq '/bin/sh -c test\ -f\ /etc/passwd'
NoMethodError:
undefined method `[]' for nil:NilClass # ./lib/specinfra/backend/ssh.rb:176:in `sudo?' # ./lib/specinfra/backend/ssh.rb:42:in `build_command' # ./spec/backend/exec/build_command_spec.rb:7:in `block (4 levels) in <top (required)>'
2) Specinfra::Backend::Exec#build_command with complex command should escape special chars
Failure/Error: expect(Specinfra.backend.build_command('test ! f /etc/selinux/config || (getenforce | grep -i - disabled && grep i - ^SELINUX=disabled$ /etc/selinux/config)')).to eq '/bin/sh c test\ \!\ -f\ /etc/selinux/config\ \|\|\ \(getenforce\ \|\ grep\ -i\ -\ disabled\ \&\&\ grep\ i\ -\ \^SELINUX\=disabled\$\ /etc/selinux/config\)'
NoMethodError:
undefined method `[]' for nil:NilClass # ./lib/specinfra/backend/ssh.rb:176:in `sudo?' # ./lib/specinfra/backend/ssh.rb:42:in `build_command' # ./spec/backend/exec/build_command_spec.rb:13:in `block (4 levels) in <top (required)>'
3) Specinfra::Backend::Exec#build_command with custom shell should use custom shell
Failure/Error: expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq '/usr/local/bin/tcsh -c test\ -f\ /etc/passwd'
NoMethodError:
undefined method `[]' for nil:NilClass # ./lib/specinfra/backend/ssh.rb:176:in `sudo?' # ./lib/specinfra/backend/ssh.rb:42:in `build_command' # ./spec/backend/exec/build_command_spec.rb:27:in `block (4 levels) in <top (required)>'
4) Specinfra::Backend::Exec#build_command with custom shell that needs escaping should use custom shell
Failure/Error: expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq '/usr/test\ \&\ spec/bin/sh -c test\ -f\ /etc/passwd'
NoMethodError:
undefined method `[]' for nil:NilClass # ./lib/specinfra/backend/ssh.rb:176:in `sudo?' # ./lib/specinfra/backend/ssh.rb:42:in `build_command' # ./spec/backend/exec/build_command_spec.rb:41:in `block (4 levels) in <top (required)>'
5) Specinfra::Backend::Exec#build_command with custom path should use custom path
Failure/Error: expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq 'env PATH="/opt/bin:/opt/foo/bin:$PATH" /bin/sh -c test\ -f\ /etc/passwd'
NoMethodError:
undefined method `[]' for nil:NilClass # ./lib/specinfra/backend/ssh.rb:176:in `sudo?' # ./lib/specinfra/backend/ssh.rb:42:in `build_command' # ./spec/backend/exec/build_command_spec.rb:55:in `block (4 levels) in <top (required)>'
6) Specinfra::Backend::Exec#build_command with custom path that needs escaping should use custom path
Failure/Error: expect(Specinfra.backend.build_command('test -f /etc/passwd')).to eq 'env PATH="/opt/bin:/opt/test & spec/bin:$PATH" /bin/sh -c test\ -f\ /etc/passwd'
NoMethodError:
undefined method `[]' for nil:NilClass # ./lib/specinfra/backend/ssh.rb:176:in `sudo?' # ./lib/specinfra/backend/ssh.rb:42:in `build_command' # ./spec/backend/exec/build_command_spec.rb:69:in `block (4 levels) in <top (required)>'
7) os test ubuntu with lsb_release command should eq {:family=>"ubuntu", :release=>"12.04", :arch=>"x86_64"}
Failure/Error: should eq({:family => 'ubuntu', :release => '12.04', :arch => 'x86_64' })
expected: {:family=>"ubuntu", :release=>"12.04", :arch=>"x86_64"}
got: {:family=>"ubuntu"}
  1. ./spec/backend/exec/build_command_spec.rb:97:in `block (3 levels) in <top (required)>'
(compared using ==)
Diff:
@ -1,4 +1,2 @
-:arch => "x86_64",
:family => "ubuntu",
-:release => "12.04",
8) os test ubuntu with /etc/lsb-release should eq {:family=>"ubuntu", :release=>"12.04", :arch=>"x86_64"}
Failure/Error: should eq({:family => 'ubuntu', :release => '12.04', :arch => 'x86_64' })
expected: {:family=>"ubuntu", :release=>"12.04", :arch=>"x86_64"}
got: "foo"
  1. ./spec/backend/exec/build_command_spec.rb:125:in `block (3 levels) in <top (required)>'
(compared using ==)
Diff:
@ -1,4 +1,2 @
-:arch => "x86_64",
-:family => "ubuntu",
-:release => "12.04",
+"foo"
9) os test debian (no lsb_release or lsb-release) should eq {:family=>"debian", :release=>nil, :arch=>"x86_64"}
Failure/Error: should eq({:family => 'debian', :release => nil, :arch => 'x86_64' })
expected: {:family=>"debian", :release=>nil, :arch=>"x86_64"}
got: "foo"
  1. ./spec/backend/exec/build_command_spec.rb:144:in `block (3 levels) in <top (required)>'
(compared using ==)
Diff:
@ -1,4 +1,2 @
-:arch => "x86_64",
-:family => "debian",
-:release => nil,
+"foo"
10) when executed process launches child process like a daemon, and the daemon doesn't close stdout,err doesn't block
Failure/Error: subject(:result) { Specinfra::Runner.run_command("ruby -e 'pid = fork { sleep 10; puts :bye }; Process.detach(pid); puts pid'") }
TypeError:
no implicit conversion of Symbol into String # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/child_process_spec.rb:6:in `block (2 levels) in &lt;top (required)&gt;' # ./spec/backend/exec/child_process_spec.rb:10:in `block (2 levels) in &lt;top (required)&gt;'
11)  should eq "ja_JP.UTF-8" 
Failure/Error: it { expect(lang).to eq 'ja_JP.UTF-8' }
expected: "ja_JP.UTF-8"
got: ""
  1. ./spec/backend/exec/env_spec.rb:13:in `block (2 levels) in <top (required)>'
(compared using )
12) buffer overflow problem with small output amount stdout only
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:43 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:12:in `block (2 levels) in &lt;top (required)&gt;'
13) buffer overflow problem with small output amount stderr only
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:43 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:17:in `block (2 levels) in &lt;top (required)&gt;'
14) buffer overflow problem with small output amount stdout then stderr
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:43 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:22:in `block (2 levels) in &lt;top (required)&gt;'
15) buffer overflow problem with small output amount stderr then stdout
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:43 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:28:in `block (2 levels) in &lt;top (required)&gt;'
16) buffer overflow problem with small output amount stdout and stderr
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:43 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:34:in `block (2 levels) in &lt;top (required)&gt;'
17) buffer overflow problem with huge output amount stdout only
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:48 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:12:in `block (2 levels) in &lt;top (required)&gt;'
18) buffer overflow problem with huge output amount stderr only
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:48 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:17:in `block (2 levels) in &lt;top (required)&gt;'
19) buffer overflow problem with huge output amount stdout then stderr
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:48 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:22:in `block (2 levels) in &lt;top (required)&gt;'
20) buffer overflow problem with huge output amount stderr then stdout
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:48 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:28:in `block (2 levels) in &lt;top (required)&gt;'
21) buffer overflow problem with huge output amount stdout and stderr
Failure/Error: Specinfra::Runner.run_command(cmd)
TypeError:
no implicit conversion of Symbol into String
Shared Example Group: "IO checks" called from ./spec/backend/exec/read_noblock_spec.rb:48 # ./lib/specinfra/helper/os.rb:8:in `include?' # ./lib/specinfra/helper/os.rb:8:in `os' # ./lib/specinfra/runner.rb:7:in `method_missing' # ./spec/backend/exec/read_noblock_spec.rb:4:in `command' # ./spec/backend/exec/read_noblock_spec.rb:34:in `block (2 levels) in &lt;top (required)&gt;'
22) foo should eq nil
Failure/Error: it { should eq Specinfra.configuration.path }
expected: nil
got: "foo"
  1. ./spec/configuration_spec.rb:8:in `block (2 levels) in &lt;top (required)&gt;'
(compared using )

#5 Обновлено Йозеф Вирек больше 2 лет назад

Оказалось, установить его в Fedora очень просто:
$ gem install serverspec

#6 Обновлено Alexei Panov больше 2 лет назад

Так можно любой пакет ruby установить, в любой системе, где стоит ruby и gem.

Экспортировать в Atom PDF