Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix child robot privileges #1819

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/swarm-engine/Swarm/Game/Step/Const.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -1542,10 +1542,10 @@ execConst runChildProg c vs s k = do
-- already has.
missingChildInv = reqInv `E.difference` childInventory

if creative
if privileged
byorgey marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand Down
1 change: 0 additions & 1 deletion swarm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions test/integration/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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"
Expand Down
Loading