Skip to content

Commit

Permalink
Add Dockerfile, fix some of the tests that made unreasonable assumptions
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Cormack <justin@specialbusservice.com>
  • Loading branch information
justincormack committed Dec 9, 2015
1 parent 9aeff88 commit 984b533
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine

RUN apk update && apk add luajit

COPY . .

ENTRYPOINT ["luajit"]
12 changes: 0 additions & 12 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2215,9 +2215,6 @@ test_proc = {
local found = false
if #ps == 0 then error "skipped" end -- not mounted but mount point exists
for i = 1, #ps do
if ps[i].pid == 1 then
assert(ps[i].cmdline:find("init") or ps[i].cmdline:find("systemd"), "expect init or systemd to be process 1 usually")
end
if ps[i].pid == me then found = true end
end
assert(found, "expect to find my process in ps")
Expand All @@ -2234,7 +2231,6 @@ test_proc = {
local p = util.proc(1)
if not p.cmdline then error "skipped" end -- no files found, /proc not mounted
assert(p and p.cmdline, "expect init to have cmdline")
assert(p.cmdline:find("init") or p.cmdline:find("systemd"), "expect init or systemd to be process 1 usually")
end,
}

Expand Down Expand Up @@ -2312,8 +2308,6 @@ test_processes = {
end,
test_fork_wait = function()
local pid0 = S.getpid()
assert(pid0 > 1, "expecting my pid to be larger than 1")
assert(S.getppid() > 1, "expecting my parent pid to be larger than 1")
local pid = assert(S.fork())
if pid == 0 then -- child
fork_assert(S.getppid() == pid0, "parent pid should be previous pid")
Expand All @@ -2327,8 +2321,6 @@ test_processes = {
end,
test_fork_waitpid = function()
local pid0 = S.getpid()
assert(pid0 > 1, "expecting my pid to be larger than 1")
assert(S.getppid() > 1, "expecting my parent pid to be larger than 1")
local pid = assert(S.fork())
if pid == 0 then -- child
fork_assert(S.getppid() == pid0, "parent pid should be previous pid")
Expand Down Expand Up @@ -2357,8 +2349,6 @@ test_processes = {
end,
test_fork_wait4 = function()
local pid0 = S.getpid()
assert(pid0 > 1, "expecting my pid to be larger than 1")
assert(S.getppid() > 1, "expecting my parent pid to be larger than 1")
local pid = assert(S.fork())
if pid == 0 then -- child
fork_assert(S.getppid() == pid0, "parent pid should be previous pid")
Expand All @@ -2373,8 +2363,6 @@ test_processes = {
end,
test_fork_wait3 = function()
local pid0 = S.getpid()
assert(pid0 > 1, "expecting my pid to be larger than 1")
assert(S.getppid() > 1, "expecting my parent pid to be larger than 1")
local pid = assert(S.fork())
if pid == 0 then -- child
fork_assert(S.getppid() == pid0, "parent pid should be previous pid")
Expand Down

0 comments on commit 984b533

Please sign in to comment.