This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from hypriot/add-or-release-tests
Add tests for Hypriot OS release
- Loading branch information
Showing
2 changed files
with
38 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
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,35 @@ | ||
require 'serverspec' | ||
set :backend, :exec | ||
|
||
describe "Root filesystem" do | ||
let(:rootfs_path) { return '/build' } | ||
|
||
it "exists" do | ||
rootfs_dir = file(rootfs_path) | ||
|
||
expect(rootfs_dir).to exist | ||
end | ||
|
||
context "Hypriot OS Release in /etc/os-release" do | ||
let(:stdout) { command("cat #{rootfs_path}/etc/os-release").stdout } | ||
|
||
it "has a HYPRIOT_OS= entry" do | ||
expect(stdout).to contain('^HYPRIOT_OS=') | ||
end | ||
it "has a HYPRIOT_TAG= entry" do | ||
expect(stdout).to contain('^HYPRIOT_TAG=') | ||
end | ||
it "has a HYPRIOT_DEVICE= entry" do | ||
expect(stdout).to contain('^HYPRIOT_DEVICE=') | ||
end | ||
|
||
it "is for architecure 'HYPRIOT_OS=\"HypriotOS/armhf\"'" do | ||
expect(stdout).to contain('^HYPRIOT_OS="HypriotOS/armhf"$') | ||
end | ||
|
||
it "is for device 'HYPRIOT_DEVICE=\"ODROID C1/C1+\"'" do | ||
expect(stdout).to contain('^HYPRIOT_DEVICE="ODROID C1/C1\+"$') | ||
end | ||
|
||
end | ||
end |