-
Notifications
You must be signed in to change notification settings - Fork 558
Jenkins soak tests #2028
Jenkins soak tests #2028
Changes from all commits
f3465aa
ac302ab
b8a60ec
6c7f511
178d4de
b308037
1db2bc8
ab10c05
9041c1a
fb882d2
49446ed
e8ed0eb
6549a4a
fad8bbc
3a319f0
b1f7ca3
1a6eb5a
2314d52
66bdfd2
e047c5c
03742ae
66918b8
4937282
9f7ff9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ func (cli *CLIProvisioner) Run() error { | |
cli.Point.RecordProvisionError() | ||
} else if i == cli.ProvisionRetries { | ||
cli.Point.RecordProvisionError() | ||
return fmt.Errorf("Exceeded provision retry count") | ||
return fmt.Errorf("Exceeded provision retry count: %s", err) | ||
} | ||
} else { | ||
cli.Point.RecordProvisionSuccess() | ||
|
@@ -76,17 +76,22 @@ func (cli *CLIProvisioner) Run() error { | |
|
||
func (cli *CLIProvisioner) provision() error { | ||
cli.Config.Name = cli.generateName() | ||
if cli.Config.SoakClusterName != "" { | ||
cli.Config.Name = cli.Config.SoakClusterName | ||
} | ||
os.Setenv("NAME", cli.Config.Name) | ||
log.Printf("Cluster name:%s\n", cli.Config.Name) | ||
|
||
outputPath := filepath.Join(cli.Config.CurrentWorkingDir, "_output") | ||
os.Mkdir(outputPath, 0755) | ||
|
||
out, err := exec.Command("ssh-keygen", "-f", cli.Config.GetSSHKeyPath(), "-q", "-N", "", "-b", "2048", "-t", "rsa").CombinedOutput() | ||
if err != nil { | ||
return fmt.Errorf("Error while trying to generate ssh key:%s\nOutput:%s", err, out) | ||
if cli.Config.SoakClusterName == "" { | ||
out, err := exec.Command("ssh-keygen", "-f", cli.Config.GetSSHKeyPath(), "-q", "-N", "", "-b", "2048", "-t", "rsa").CombinedOutput() | ||
if err != nil { | ||
return fmt.Errorf("Error while trying to generate ssh key:%s\nOutput:%s", err, out) | ||
} | ||
exec.Command("chmod", "0600", cli.Config.GetSSHKeyPath()+"*") | ||
} | ||
exec.Command("chmod", "0600", cli.Config.GetSSHKeyPath()+"*") | ||
|
||
publicSSHKey, err := cli.Config.ReadPublicSSHKey() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the above keygen is skipped when soak cluster name is provided, should the publicSSHKey part be skipped too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The keygen is skipped because for Jenkins soak test the tests use the Jenkins key so it is not necessary to generate a new key. However, the cli provisioner still needs to read the public key that was provided. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to confirm, so the public key is not the one generated by keygen, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's the one in _output/cluster-name-ssh which is created before the test is started There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the clarification. |
||
if err != nil { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this belong to some cleanup step (maybe the teardown function at the bottom of this file)? The comments on this section of code says it is for provisioning a cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I put this here is that when generating a new soak cluster it is necessary to delete the previously existing soak cluster before deploying a new one since they use the same resource group (and we want to make sure we don't keep them after we're done testing on them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the explanation.