Fix child robot privileges (#1819)

Fixes #1664
This commit is contained in:
Karl Ostmo 2024-05-04 09:13:32 -07:00 committed by GitHub
parent db920dfa83
commit e39255fbd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View File

@ -1485,7 +1485,7 @@ execConst runChildProg c vs s k = do
checkRequirements parentInventory childInventory childDevices cmd subject fixI = do
currentContext <- use $ robotContext . defReqs
em <- use $ landscape . terrainAndEntities . entityMap
creative <- use creativeMode
privileged <- isPrivilegedBot
let -- Note that _capCtx must be empty: at least at the
-- moment, definitions are only allowed at the top level,
-- so there can't be any inside the argument to build.
@ -1542,10 +1542,10 @@ execConst runChildProg c vs s k = do
-- already has.
missingChildInv = reqInv `E.difference` childInventory
if creative
if privileged
then
return
( -- In creative mode, just equip ALL the devices
( -- When 'privileged', just equip ALL the devices
-- providing each required capability (because, why
-- not?). But don't re-equip any that are already
-- equipped.

View File

@ -932,7 +932,6 @@ test-suite swarm-integration
lens,
mtl,
tasty >=0.10 && <1.6,
tasty-expected-failure >=0.12 && <0.13,
tasty-hunit >=0.10 && <0.11,
text,
witch,

View File

@ -84,7 +84,6 @@ import Swarm.Util.Yaml (decodeFileEitherE)
import System.FilePath.Posix (splitDirectories)
import System.Timeout (timeout)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.ExpectedFailure (expectFailBecause)
import Test.Tasty.HUnit (Assertion, assertBool, assertEqual, assertFailure, testCase)
import Witch (into)
@ -309,7 +308,7 @@ testScenarioSolutions rs ui =
, testSolution Default "Testing/201-require/201-require-entities-def"
, testSolution Default "Testing/201-require/533-reprogram-simple"
, testSolution Default "Testing/201-require/533-reprogram"
, expectFailBecause "Fix #1664" $ testSolution Default "Testing/201-require/1664-require-system-robot-children"
, testSolution Default "Testing/201-require/1664-require-system-robot-children"
]
, testSolution Default "Testing/479-atomic-race"
, testSolution (Sec 5) "Testing/479-atomic"