Revision 3db3eb2a qa/qa_cluster.py
b/qa/qa_cluster.py | ||
---|---|---|
151 | 151 |
|
152 | 152 |
# Conflicting options |
153 | 153 |
cmd = ["gnt-cluster", "renew-crypto", "--force", |
154 |
"--new-cluster-certificate", "--new-confd-hmac-key", |
|
155 |
"--new-rapi-certificate", "--rapi-certificate=/dev/null"] |
|
156 |
AssertNotEqual(StartSSH(master["primary"], |
|
157 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
154 |
"--new-cluster-certificate", "--new-confd-hmac-key"] |
|
155 |
conflicting = [ |
|
156 |
["--new-rapi-certificate", "--rapi-certificate=/dev/null"], |
|
157 |
["--new-cluster-domain-secret", "--cluster-domain-secret=/dev/null"], |
|
158 |
] |
|
159 |
for i in conflicting: |
|
160 |
AssertNotEqual(StartSSH(master["primary"], |
|
161 |
utils.ShellQuoteArgs(cmd + i)).wait(), 0) |
|
158 | 162 |
|
159 | 163 |
# Invalid RAPI certificate |
160 | 164 |
cmd = ["gnt-cluster", "renew-crypto", "--force", |
... | ... | |
181 | 185 |
AssertEqual(StartSSH(master["primary"], |
182 | 186 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
183 | 187 |
|
188 |
# Custom cluster domain secret |
|
189 |
cds_fh = tempfile.NamedTemporaryFile() |
|
190 |
cds_fh.write(utils.GenerateSecret()) |
|
191 |
cds_fh.write("\n") |
|
192 |
cds_fh.flush() |
|
193 |
|
|
194 |
tmpcds = qa_utils.UploadFile(master["primary"], cds_fh.name) |
|
195 |
try: |
|
196 |
cmd = ["gnt-cluster", "renew-crypto", "--force", |
|
197 |
"--cluster-domain-secret=%s" % tmpcds] |
|
198 |
AssertEqual(StartSSH(master["primary"], |
|
199 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
200 |
finally: |
|
201 |
cmd = ["rm", "-f", tmpcds] |
|
202 |
AssertEqual(StartSSH(master["primary"], |
|
203 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
|
204 |
|
|
184 | 205 |
# Normal case |
185 | 206 |
cmd = ["gnt-cluster", "renew-crypto", "--force", |
186 | 207 |
"--new-cluster-certificate", "--new-confd-hmac-key", |
187 |
"--new-rapi-certificate"] |
|
208 |
"--new-rapi-certificate", "--new-cluster-domain-secret"]
|
|
188 | 209 |
AssertEqual(StartSSH(master["primary"], |
189 | 210 |
utils.ShellQuoteArgs(cmd)).wait(), 0) |
190 | 211 |
|
Also available in: Unified diff