Commit a7667ba6 authored by Iustin Pop's avatar Iustin Pop
Browse files

Do not rely on no-secondary for movable tests



Currently, the code in Loader.hs marks as un-movable any instances
which don't have a secondary. This is not valid for any shared storage
templates, so let's remove that check completely. The initial state of
the instance will reflect correctly the movable status, based on the
disk template of the instance, so we don't need to re-do this check.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent b7743258
......@@ -241,8 +241,7 @@ updateMovable :: [String] -- ^ Selected instances (if not empty)
-> Instance.Instance -- ^ Target Instance
-> Instance.Instance -- ^ Target Instance with updated attribute
updateMovable selinsts exinsts inst =
if Instance.sNode inst == Node.noSecondary ||
Instance.name inst `elem` exinsts ||
if Instance.name inst `elem` exinsts ||
not (null selinsts || Instance.name inst `elem` selinsts)
then Instance.setMovable inst False
else inst
......
......@@ -853,10 +853,9 @@ prop_Text_CreateSerialise =
forAll (choose (2, 10)) $ \count ->
forAll genOnlineNode $ \node ->
forAll (genInstanceSmallerThanNode node) $ \inst ->
let inst' = Instance.setMovable inst (reqnodes == 2)
nl = makeSmallCluster node count
let nl = makeSmallCluster node count
in case Cluster.genAllocNodes defGroupList nl reqnodes True >>= \allocn ->
Cluster.iterateAlloc nl Container.empty (Just maxiter) inst' allocn [] []
Cluster.iterateAlloc nl Container.empty (Just maxiter) inst allocn [] []
of
Types.Bad msg -> failTest $ "Failed to allocate: " ++ msg
Types.Ok (_, _, _, [], _) -> printTestCase
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment