Revision 20bc5360 htest/Test/Ganeti/Rpc.hs

b/htest/Test/Ganeti/Rpc.hs
53 53
-- offline nodes, we get a OfflineNodeError response.
54 54
-- FIXME: We need a way of generalizing this, running it for
55 55
-- every call manually will soon get problematic
56
prop_Rpc_noffl_request_allinstinfo :: Rpc.RpcCallAllInstancesInfo -> Property
57
prop_Rpc_noffl_request_allinstinfo call =
56
prop_noffl_request_allinstinfo :: Rpc.RpcCallAllInstancesInfo -> Property
57
prop_noffl_request_allinstinfo call =
58 58
  forAll (arbitrary `suchThat` Objects.nodeOffline) $ \node -> monadicIO $ do
59 59
      res <- run $ Rpc.executeRpcCall [node] call
60 60
      stop $ res ==? [(node, Left (Rpc.OfflineNodeError node))]
61 61

  
62
prop_Rpc_noffl_request_instlist :: Rpc.RpcCallInstanceList -> Property
63
prop_Rpc_noffl_request_instlist call =
62
prop_noffl_request_instlist :: Rpc.RpcCallInstanceList -> Property
63
prop_noffl_request_instlist call =
64 64
  forAll (arbitrary `suchThat` Objects.nodeOffline) $ \node -> monadicIO $ do
65 65
      res <- run $ Rpc.executeRpcCall [node] call
66 66
      stop $ res ==? [(node, Left (Rpc.OfflineNodeError node))]
67 67

  
68
prop_Rpc_noffl_request_nodeinfo :: Rpc.RpcCallNodeInfo -> Property
69
prop_Rpc_noffl_request_nodeinfo call =
68
prop_noffl_request_nodeinfo :: Rpc.RpcCallNodeInfo -> Property
69
prop_noffl_request_nodeinfo call =
70 70
  forAll (arbitrary `suchThat` Objects.nodeOffline) $ \node -> monadicIO $ do
71 71
      res <- run $ Rpc.executeRpcCall [node] call
72 72
      stop $ res ==? [(node, Left (Rpc.OfflineNodeError node))]
73 73

  
74 74
testSuite "Rpc"
75
  [ 'prop_Rpc_noffl_request_allinstinfo
76
  , 'prop_Rpc_noffl_request_instlist
77
  , 'prop_Rpc_noffl_request_nodeinfo
75
  [ 'prop_noffl_request_allinstinfo
76
  , 'prop_noffl_request_instlist
77
  , 'prop_noffl_request_nodeinfo
78 78
  ]

Also available in: Unified diff