Safe Haskell | None |
---|
Unittests for Instance Queries.
Synopsis
- createInstance :: String -> String -> AdminState -> AdminStateSource -> Instance
- fakeInstanceInfo :: InstanceInfo
- responseError :: String -> (String, ERpcError a)
- responseSuccess :: String -> [String] -> (String, ERpcError RpcResultAllInstancesInfo)
- waldoInstance :: Instance
- case_nodeOffline :: Assertion
- case_nodeOnlineNoInfo :: Assertion
- case_infoOnPrimary :: Assertion
- case_infoOnSecondary :: Assertion
- testQuery_Instance :: Test
Documentation
createInstance :: String -> String -> AdminState -> AdminStateSource -> Instance Source #
Creates an instance with the desired name, pnode uuid,
AdminState
, and AdminStateSource
. All other fields are
placeholders.
fakeInstanceInfo :: InstanceInfo Source #
A fake InstanceInfo to be used to check values.
responseError :: String -> (String, ERpcError a) Source #
Erroneous node response - the exact error does not matter.
responseSuccess :: String -> [String] -> (String, ERpcError RpcResultAllInstancesInfo) Source #
Successful response - the error does not really matter.
waldoInstance :: Instance Source #
The instance used for testing. Called Waldo as test cases involve trouble finding information related to it.
case_nodeOffline :: Assertion Source #
Check that an error is thrown when the node is offline
case_nodeOnlineNoInfo :: Assertion Source #
Check that a Right Nothing is returned when the node is online, yet no info is present anywhere in the system.
case_infoOnPrimary :: Assertion Source #
Check the case when the info is on the primary node
case_infoOnSecondary :: Assertion Source #
Check the case when the info is on the primary node
testQuery_Instance :: Test Source #