Revision da5f09ef test/py/ganeti.cli_unittest.py
b/test/py/ganeti.cli_unittest.py | ||
---|---|---|
1141 | 1141 |
|
1142 | 1142 |
def testClusterPolicy(self): |
1143 | 1143 |
exp_pol0 = { |
1144 |
constants.ISPECS_MIN: {}, |
|
1145 |
constants.ISPECS_MAX: {}, |
|
1144 |
constants.ISPECS_MINMAX: { |
|
1145 |
constants.ISPECS_MIN: {}, |
|
1146 |
constants.ISPECS_MAX: {}, |
|
1147 |
}, |
|
1146 | 1148 |
constants.ISPECS_STD: {}, |
1147 | 1149 |
} |
1148 | 1150 |
exp_pol1 = { |
1149 |
constants.ISPECS_MIN: { |
|
1150 |
constants.ISPEC_CPU_COUNT: 2, |
|
1151 |
constants.ISPEC_DISK_COUNT: 1, |
|
1152 |
}, |
|
1153 |
constants.ISPECS_MAX: { |
|
1154 |
constants.ISPEC_MEM_SIZE: 12*1024, |
|
1155 |
constants.ISPEC_DISK_COUNT: 2, |
|
1151 |
constants.ISPECS_MINMAX: { |
|
1152 |
constants.ISPECS_MIN: { |
|
1153 |
constants.ISPEC_CPU_COUNT: 2, |
|
1154 |
constants.ISPEC_DISK_COUNT: 1, |
|
1155 |
}, |
|
1156 |
constants.ISPECS_MAX: { |
|
1157 |
constants.ISPEC_MEM_SIZE: 12*1024, |
|
1158 |
constants.ISPEC_DISK_COUNT: 2, |
|
1159 |
}, |
|
1156 | 1160 |
}, |
1157 | 1161 |
constants.ISPECS_STD: { |
1158 | 1162 |
constants.ISPEC_CPU_COUNT: 2, |
... | ... | |
1161 | 1165 |
constants.IPOLICY_VCPU_RATIO: 3.1, |
1162 | 1166 |
} |
1163 | 1167 |
exp_pol2 = { |
1164 |
constants.ISPECS_MIN: { |
|
1165 |
constants.ISPEC_DISK_SIZE: 512, |
|
1166 |
constants.ISPEC_NIC_COUNT: 2, |
|
1167 |
}, |
|
1168 |
constants.ISPECS_MAX: { |
|
1169 |
constants.ISPEC_NIC_COUNT: 3, |
|
1168 |
constants.ISPECS_MINMAX: { |
|
1169 |
constants.ISPECS_MIN: { |
|
1170 |
constants.ISPEC_DISK_SIZE: 512, |
|
1171 |
constants.ISPEC_NIC_COUNT: 2, |
|
1172 |
}, |
|
1173 |
constants.ISPECS_MAX: { |
|
1174 |
constants.ISPEC_NIC_COUNT: 3, |
|
1175 |
}, |
|
1170 | 1176 |
}, |
1171 | 1177 |
constants.ISPECS_STD: { |
1172 | 1178 |
constants.ISPEC_CPU_COUNT: 2, |
... | ... | |
1245 | 1251 |
def testAllowedValues(self): |
1246 | 1252 |
allowedv = "blah" |
1247 | 1253 |
exp_pol1 = { |
1248 |
constants.ISPECS_MIN: { |
|
1249 |
constants.ISPEC_CPU_COUNT: allowedv, |
|
1250 |
}, |
|
1251 |
constants.ISPECS_MAX: { |
|
1254 |
constants.ISPECS_MINMAX: { |
|
1255 |
constants.ISPECS_MIN: { |
|
1256 |
constants.ISPEC_CPU_COUNT: allowedv, |
|
1257 |
}, |
|
1258 |
constants.ISPECS_MAX: { |
|
1259 |
}, |
|
1252 | 1260 |
}, |
1253 | 1261 |
constants.ISPECS_STD: { |
1254 | 1262 |
}, |
Also available in: Unified diff