Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from hypriot/add-or-release-tests
Browse files Browse the repository at this point in the history
Add tests for Hypriot OS release
  • Loading branch information
DieterReuter committed Jan 17, 2016
2 parents 2dc1b63 + d0490ed commit 1d7dba7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ sd-image: build

shell: build
docker run -ti --privileged -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules image-builder-odroid-c1 bash

testshell: build
docker run -ti --privileged -v $(shell pwd)/builder:/builder -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules image-builder-odroid-c1 bash
35 changes: 35 additions & 0 deletions builder/test/os-release_spec.rb
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

0 comments on commit 1d7dba7

Please sign in to comment.