Answer stability round 2: 1 🔴, 2 🟡 (0 misread); drop a --memory of 0 so the added limit stands, pin the 6m floor's edge, test env --unset, env --ignore-environment and doas, and say on Linux in the rule text
This commit is contained in:
@@ -13,6 +13,9 @@ class Capped(unittest.TestCase):
|
||||
(["run", "img", "python", "-m", "pytest"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "img", "python", "-m", "pytest"]),
|
||||
(["run", "img", "grep", "-m", "1", "x"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "img", "grep", "-m", "1", "x"]),
|
||||
(["run", "img", "git", "tag", "-m", "1.2.3"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "img", "git", "tag", "-m", "1.2.3"]),
|
||||
(["run", "-m", "0", "img"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "img"]),
|
||||
(["run", "-m", "6143k", "img"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "-m", "6143k", "img"]),
|
||||
(["run", "img", "tool", "-m", "6"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "img", "tool", "-m", "6"]),
|
||||
(["run", "img", "stress", "--memory", "2"], ["run", "--memory", "6144m", "--memory-swap", "6144m", "img", "stress", "--memory", "2"]),
|
||||
]:
|
||||
with self.subTest(given):
|
||||
@@ -21,6 +24,7 @@ class Capped(unittest.TestCase):
|
||||
def test_a_container_s_own_limit_is_kept_and_sets_the_limit_it_lacks(self):
|
||||
for given, expected in [
|
||||
(["run", "-m", "10g", "img"], ["run", "--memory-swap", "10g", "-m", "10g", "img"]),
|
||||
(["run", "-m", "6m", "img"], ["run", "--memory-swap", "6m", "-m", "6m", "img"]),
|
||||
(["run", "--memory=12g", "img"], ["run", "--memory-swap", "12g", "--memory=12g", "img"]),
|
||||
(["run", "--memory-swap", "2g", "img"], ["run", "--memory", "2g", "--memory-swap", "2g", "img"]),
|
||||
(["run", "-m", "4g", "--memory-swap", "-1", "img"], ["run", "--memory-swap", "4g", "-m", "4g", "img"]),
|
||||
|
||||
Reference in New Issue
Block a user