Revision 61bbbed7 htools/Ganeti/HTools/QC.hs
b/htools/Ganeti/HTools/QC.hs  

695  695 
  Check that an instance add with too high memory or disk will be 
696  696 
 rejected. 
697  697 
prop_Node_addPriFM node inst = Instance.mem inst >= Node.fMem node && 
698 
not (Node.failN1 node) 

698 
not (Node.failN1 node) && 

699 
not (Instance.instanceOffline inst) 

699  700 
==> 
700  701 
case Node.addPri node inst'' of 
701  702 
Types.OpFail Types.FailMem > True 
...  ...  
715  716 
inst'' = inst' { Instance.dsk = Instance.dsk inst } 
716  717  
717  718 
prop_Node_addPriFC node inst (Positive extra) = 
718 
not (Node.failN1 node) ==> 

719 
not (Node.failN1 node) && 

720 
not (Instance.instanceOffline inst) ==> 

719  721 
case Node.addPri node inst'' of 
720  722 
Types.OpFail Types.FailCPU > True 
721  723 
_ > False 
...  ...  
726  728 
  Check that an instance add with too high memory or disk will be 
727  729 
 rejected. 
728  730 
prop_Node_addSec node inst pdx = 
729 
(Instance.mem inst >= (Node.fMem node  Node.rMem node)  

731 
((Instance.mem inst >= (Node.fMem node  Node.rMem node) && 

732 
not (Instance.instanceOffline inst))  

730  733 
Instance.dsk inst >= Node.fDsk node) && 
731  734 
not (Node.failN1 node) 
732  735 
==> isFailure (Node.addSec node inst pdx) 
733  736 
where _types = (node::Node.Node, inst::Instance.Instance, pdx::Int) 
734  737  
738 
  Check that an offline instance with reasonable disk size can always 

739 
 be added. 

740 
prop_Node_addPriOffline node = 

741 
forAll (arbitrary `suchThat` 

742 
(\ x > (Instance.dsk x < Node.fDsk node) && 

743 
Instance.instanceOffline x)) $ \inst > 

744 
case Node.addPri node inst of 

745 
Types.OpGood _ > True 

746 
_ > False 

747  
748 
prop_Node_addSecOffline node pdx = 

749 
forAll (arbitrary `suchThat` 

750 
(\ x > (Instance.dsk x < Node.fDsk node) && 

751 
Instance.instanceOffline x)) $ \inst > 

752 
case Node.addSec node inst pdx of 

753 
Types.OpGood _ > True 

754 
_ > False 

755  
735  756 
  Checks for memory reservation changes. 
736  757 
prop_Node_rMem inst = 
758 
not (Instance.instanceOffline inst) ==> 

737  759 
forAll (arbitrary `suchThat` ((> Types.unitMem) . Node.fMem)) $ \node > 
738  760 
 ab = auto_balance, nb = nonauto_balance 
739  761 
 we use 1 as the primary node of the instance 
...  ...  
808  830 
, 'prop_Node_addPriFD 
809  831 
, 'prop_Node_addPriFC 
810  832 
, 'prop_Node_addSec 
833 
, 'prop_Node_addPriOffline 

834 
, 'prop_Node_addSecOffline 

811  835 
, 'prop_Node_rMem 
812  836 
, 'prop_Node_setMdsk 
813  837 
, 'prop_Node_tagMaps_idempotent 
Also available in: Unified diff