Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(kichen+travis): test with pre-salted Docker images #36

Merged
merged 1 commit into from
May 23, 2019
Merged

ci(kichen+travis): test with pre-salted Docker images #36

merged 1 commit into from
May 23, 2019

Conversation

n-rodriguez
Copy link
Member

No description provided.

@n-rodriguez n-rodriguez requested a review from myii May 13, 2019 22:08
@myii myii requested a review from aboe76 May 13, 2019 22:29
Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent start. Will need to update https://github.com/saltstack-formulas/systemd-formula/blob/master/test/integration/default/inspec.yml in order to get inspec tests running on all platforms. For example, no tests running here:

@n-rodriguez
Copy link
Member Author

@myii
Copy link
Member

myii commented May 13, 2019

It's only one of them (opensuse-leap-15-2019-2-py3) and only failing a few of the tests:

Profile: Systemd Formula (systemd)
Version: (not specified)
Target:  ssh://kitchen@localhost:32768
  ✔  Systemd package: should be installed
     ✔  System Package systemd should be installed
  ×  Systemd units: should match desired lines (1 failed)
     ✔  File /etc/systemd/system/syncthing-someuser.service type should eq :file
     ✔  File /etc/systemd/system/syncthing-someuser.service mode should cmp == "0644"
     ✔  File /etc/systemd/system/syncthing-someuser.service owner should eq "root"
     ✔  File /etc/systemd/system/syncthing-someuser.service group should eq "root"
     ×  Service syncthing-someuser.service should be enabled
     expected that `Service syncthing-someuser.service` is enabled
  ×  Systemd Networkd: should match desired lines (3 failed)
     ✔  File /etc/systemd/network type should eq :directory
     ✔  File /etc/systemd/network mode should cmp == "0755"
     ✔  File /etc/systemd/network owner should eq "root"
     ✔  File /etc/systemd/network group should eq "root"
     ✔  File /etc/systemd/network/99-default.link type should eq :file
     ✔  File /etc/systemd/network/99-default.link mode should cmp == "0644"
     ✔  File /etc/systemd/network/99-default.link owner should eq "root"
     ✔  File /etc/systemd/network/99-default.link group should eq "root"
     ✔  File /etc/systemd/network/eth0.network type should eq :file
     ✔  File /etc/systemd/network/eth0.network mode should cmp == "0644"
     ✔  File /etc/systemd/network/eth0.network owner should eq "root"
     ✔  File /etc/systemd/network/eth0.network group should eq "root"
     ✔  File /etc/systemd/network/br0.netdev type should eq :file
     ✔  File /etc/systemd/network/br0.netdev mode should cmp == "0644"
     ✔  File /etc/systemd/network/br0.netdev owner should eq "root"
     ✔  File /etc/systemd/network/br0.netdev group should eq "root"
     ✔  File /etc/systemd/network/10-dmz.link type should eq :file
     ✔  File /etc/systemd/network/10-dmz.link mode should cmp == "0644"
     ✔  File /etc/systemd/network/10-dmz.link owner should eq "root"
     ✔  File /etc/systemd/network/10-dmz.link group should eq "root"
     ✔  File /etc/systemd/network/10-internet.link type should eq :file
     ✔  File /etc/systemd/network/10-internet.link mode should cmp == "0644"
     ✔  File /etc/systemd/network/10-internet.link owner should eq "root"
     ✔  File /etc/systemd/network/10-internet.link group should eq "root"
     ×  Service systemd-networkd should be enabled
     expected that `Service systemd-networkd` is enabled
     ×  Service systemd-networkd should be running
     expected that `Service systemd-networkd` is running
     ×  Service systemd-networkd-wait-online should be enabled
     expected that `Service systemd-networkd-wait-online` is enabled
Profile Summary: 1 successful control, 2 control failures, 0 controls skipped
Test Summary: 29 successful, 4 failures, 0 skipped

@aboe76
Copy link
Member

aboe76 commented May 14, 2019

@n-rodriguez can't see why this would fail only on opensuse 15.0,
started the same container on my own test machine:

docker run --privileged --rm -it netmanagers/salt-2019.2-py3:opensuse-leap-15 /usr/lib/systemd/systemd

next entered the container:

docker exec -it 8cfef52997ad bash
cfef52997ad:/etc/systemd/network # systemctl enable systemd-networkd --now
Created symlink /etc/systemd/system/network.service → /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /etc/systemd/system/dbus-org.freedesktop.network1.service → /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-networkd.service → /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /usr/lib/systemd/system/systemd-networkd.socket.
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /usr/lib/systemd/system/systemd-networkd-wait-online.service.
8cfef52997ad:/etc/systemd/network # systemctl status systemd-networkd
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-05-14 17:33:30 UTC; 3s ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 345 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /docker/8cfef52997adc8d3f05498f4e725ab53130d39fc6fee410310dee08343a9d9b8/system.slice/systemd-networkd.service
           └─345 /usr/lib/systemd/systemd-networkd

May 14 17:33:30 8cfef52997ad systemd[1]: Starting Network Service...
May 14 17:33:30 8cfef52997ad systemd-networkd[345]: Enumeration completed
May 14 17:33:30 8cfef52997ad systemd[1]: Started Network Service.

so it should work...

Copy link
Member

@aboe76 aboe76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested the formula on tumbleweed(opensuse rolling release) so I'm ok with one test failing...

@n-rodriguez
Copy link
Member Author

I have tested the formula on tumbleweed(opensuse rolling release) so I'm ok with one test failing...

it might be a bug within inspec...

@n-rodriguez
Copy link
Member Author

it might be a bug within inspec...

no... systemd-network was not enabled :

cfef52997ad:/etc/systemd/network # systemctl enable systemd-networkd --now
Created symlink /etc/systemd/system/network.service → /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /etc/systemd/system/dbus-org.freedesktop.network1.service → /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/systemd-networkd.service → /usr/lib/systemd/system/systemd-networkd.service.
Created symlink /etc/systemd/system/sockets.target.wants/systemd-networkd.socket → /usr/lib/systemd/system/systemd-networkd.socket.
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /usr/lib/systemd/system/systemd-networkd-wait-online.service

@javierbertoli
Copy link
Member

javierbertoli commented May 14, 2019

@n-rodriguez the issue is an inspec/train+suse/opensuse one, we hit the same problem on the template-formula, see here

Running it locally you can see that systemd-networkd is enabled and running

ffcf8cee52fd:~ # ps axuw|grep networkd
systemd+   830  0.0  0.0  61644  4992 ?        Ss   18:33   0:00 /usr/lib/systemd/systemd-networkd
ffcf8cee52fd:~ # systemctl status systemd-networkd
* systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-05-14 18:33:58 UTC; 6min ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 830 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /docker/ffcf8cee52fd90f2df94d3c7ee4b6548c95ca60174d76204a2c2be1985b95f2e/system.slice/systemd-networkd.service
           `-830 /usr/lib/systemd/systemd-networkd

May 14 18:33:58 ffcf8cee52fd systemd[1]: Starting Network Service...
May 14 18:33:58 ffcf8cee52fd systemd-networkd[830]: br0: netdev ready
May 14 18:33:58 ffcf8cee52fd systemd-networkd[830]: Enumeration completed
May 14 18:33:58 ffcf8cee52fd systemd[1]: Started Network Service.

@aboe76
Copy link
Member

aboe76 commented May 14, 2019

@javierbertoli thanks for finding this.

@n-rodriguez
Copy link
Member Author

well... that's weird...

nicolas@cloud:~/SALT/ufw-formula$ bundle exec kitchen login default-opensuse-leap-15-2019-2-py3
Last login: Wed May 15 19:17:33 2019 from 172.17.0.1
Have a lot of fun...
kitchen@ab3c49a5edd3:~> cat /etc/SuSE-release 
NAME="openSUSE Leap"
VERSION="15.0"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.0"
PRETTY_NAME="openSUSE Leap 15.0"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.0"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
kitchen@ab3c49a5edd3:~> 

@n-rodriguez
Copy link
Member Author

n-rodriguez commented May 15, 2019

nicolas@cloud:~/SALT/systemd-formula$ bundle exec kitchen verify default-opensuse-leap-15-2019-2-py3
-----> Starting Kitchen (v2.2.4)
-----> Verifying <default-opensuse-leap-15-2019-2-py3>...
[2019-05-15T21:38:59+02:00] WARN: DEPRECATION: InSpec Attributes are being renamed to InSpec Inputs to avoid confusion with Chef Attributes. Use --input-file on the command line instead of --attrs.
       Loaded systemd 
[2019-05-15T21:39:01+02:00] WARN: DEPRECATION: The service `be_running?` matcher is deprecated. This is only allowed for compatibility with ServerSpec (used at /data/nicolas/SALT/systemd-formula/test/integration/default/controls/networkd_spec.rb:48)
e
Profile: Systemd Formula (systemd)
Version: (not specified)
Target:  ssh://kitchen@localhost:32778

  ✔  Systemd units: should match desired lines
     ✔  File /etc/systemd/system/syncthing-someuser.service type should eq :file
     ✔  File /etc/systemd/system/syncthing-someuser.service mode should cmp == "0644"
     ✔  File /etc/systemd/system/syncthing-someuser.service owner should eq "root"
     ✔  File /etc/systemd/system/syncthing-someuser.service group should eq "root"
     ✔  Service syncthing-someuser.service should be enabled
  ✔  Systemd Networkd: should match desired lines
     ✔  File /etc/systemd/network type should eq :directory
     ✔  File /etc/systemd/network mode should cmp == "0755"
     ✔  File /etc/systemd/network owner should eq "root"
     ✔  File /etc/systemd/network group should eq "root"
     ✔  File /etc/systemd/network/99-default.link type should eq :file
     ✔  File /etc/systemd/network/99-default.link mode should cmp == "0644"
     ✔  File /etc/systemd/network/99-default.link owner should eq "root"
     ✔  File /etc/systemd/network/99-default.link group should eq "root"
     ✔  File /etc/systemd/network/eth0.network type should eq :file
     ✔  File /etc/systemd/network/eth0.network mode should cmp == "0644"
     ✔  File /etc/systemd/network/eth0.network owner should eq "root"
     ✔  File /etc/systemd/network/eth0.network group should eq "root"
     ✔  File /etc/systemd/network/br0.netdev type should eq :file
     ✔  File /etc/systemd/network/br0.netdev mode should cmp == "0644"
     ✔  File /etc/systemd/network/br0.netdev owner should eq "root"
     ✔  File /etc/systemd/network/br0.netdev group should eq "root"
     ✔  File /etc/systemd/network/10-dmz.link type should eq :file
     ✔  File /etc/systemd/network/10-dmz.link mode should cmp == "0644"
     ✔  File /etc/systemd/network/10-dmz.link owner should eq "root"
     ✔  File /etc/systemd/network/10-dmz.link group should eq "root"
     ✔  File /etc/systemd/network/10-internet.link type should eq :file
     ✔  File /etc/systemd/network/10-internet.link mode should cmp == "0644"
     ✔  File /etc/systemd/network/10-internet.link owner should eq "root"
     ✔  File /etc/systemd/network/10-internet.link group should eq "root"
     ✔  Service systemd-networkd should be enabled
     ✔  Service systemd-networkd should be running
     ✔  Service systemd-networkd-wait-online should be enabled
  ✔  Systemd package: should be installed
     ✔  System Package systemd should be installed


Profile Summary: 3 successful controls, 0 control failures, 0 controls skipped
Test Summary: 33 successful, 0 failures, 0 skipped
       Finished verifying <default-opensuse-leap-15-2019-2-py3> (0m3.54s).
-----> Kitchen is finished. (0m5.27s)
nicolas@cloud:~/SALT/systemd-formula$ 

@n-rodriguez
Copy link
Member Author

@myii
Copy link
Member

myii commented May 15, 2019

Great work @n-rodriguez!

@aboe76
Copy link
Member

aboe76 commented May 16, 2019

@n-rodriguez nice find

@aboe76 aboe76 requested a review from myii May 20, 2019 20:48
@aboe76
Copy link
Member

aboe76 commented May 22, 2019

@n-rodriguez and @myii can we merge this one?

Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the matrix reduction, thanks.

.travis.yml Outdated Show resolved Hide resolved
@n-rodriguez
Copy link
Member Author

@n-rodriguez and @myii can we merge this one?

I'd like to, but I'm waiting for release 2.1.6 of train on rubygems.

@n-rodriguez n-rodriguez requested a review from myii May 23, 2019 23:37
@myii myii merged commit 0fd77f7 into saltstack-formulas:master May 23, 2019
@myii
Copy link
Member

myii commented May 23, 2019

@n-rodriguez Merged, thanks for this PR and for fixing train upstream!

@n-rodriguez n-rodriguez deleted the wip/kitchen branch May 23, 2019 23:50
@saltstack-formulas-travis

🎉 This PR is included in version 0.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants