add checksums to tests, formatting after rebase
This commit is contained in:
parent
1a35649ea1
commit
fb8066d8f3
|
@ -123,11 +123,12 @@ func TestExecDriver_Start_Wait(t *testing.T) {
|
||||||
func TestExecDriver_Start_Artifact_basic(t *testing.T) {
|
func TestExecDriver_Start_Artifact_basic(t *testing.T) {
|
||||||
ctestutils.ExecCompatible(t)
|
ctestutils.ExecCompatible(t)
|
||||||
file := "hi_linux_amd64"
|
file := "hi_linux_amd64"
|
||||||
|
checksum := "sha256:6f99b4c5184726e601ecb062500aeb9537862434dfe1898dbe5c68d9f50c179c"
|
||||||
|
|
||||||
task := &structs.Task{
|
task := &structs.Task{
|
||||||
Name: "sleep",
|
Name: "sleep",
|
||||||
Config: map[string]string{
|
Config: map[string]string{
|
||||||
"artifact_source": fmt.Sprintf("https://dl.dropboxusercontent.com/u/47675/jar_thing/%s", file),
|
"artifact_source": fmt.Sprintf("https://dl.dropboxusercontent.com/u/47675/jar_thing/%s?checksum=%s", file, checksum),
|
||||||
"command": filepath.Join("$NOMAD_TASK_DIR", file),
|
"command": filepath.Join("$NOMAD_TASK_DIR", file),
|
||||||
},
|
},
|
||||||
Resources: basicResources,
|
Resources: basicResources,
|
||||||
|
|
|
@ -99,6 +99,7 @@ func TestJavaDriver_Start_Wait(t *testing.T) {
|
||||||
Config: map[string]string{
|
Config: map[string]string{
|
||||||
"artifact_source": "https://dl.dropboxusercontent.com/u/47675/jar_thing/demoapp.jar",
|
"artifact_source": "https://dl.dropboxusercontent.com/u/47675/jar_thing/demoapp.jar",
|
||||||
"jvm_options": "-Xmx2048m -Xms256m",
|
"jvm_options": "-Xmx2048m -Xms256m",
|
||||||
|
"checksum": "sha256:58d6e8130308d32e197c5108edd4f56ddf1417408f743097c2e662df0f0b17c8",
|
||||||
},
|
},
|
||||||
Resources: basicResources,
|
Resources: basicResources,
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,12 +94,14 @@ func TestRawExecDriver_StartOpen_Wait(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRawExecDriver_Start_Artifact_basic(t *testing.T) {
|
func TestRawExecDriver_Start_Artifact_basic(t *testing.T) {
|
||||||
var file string
|
var file, checksum string
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
file = "hi_darwin_amd64"
|
file = "hi_darwin_amd64"
|
||||||
|
checksum = "md5:d7f2fdb13b36dcb7407721d78926b335"
|
||||||
default:
|
default:
|
||||||
file = "hi_linux_amd64"
|
file = "hi_linux_amd64"
|
||||||
|
checksum = "md5:a9b14903a8942748e4f8474e11f795d3"
|
||||||
}
|
}
|
||||||
|
|
||||||
task := &structs.Task{
|
task := &structs.Task{
|
||||||
|
@ -107,6 +109,7 @@ func TestRawExecDriver_Start_Artifact_basic(t *testing.T) {
|
||||||
Config: map[string]string{
|
Config: map[string]string{
|
||||||
"artifact_source": fmt.Sprintf("https://dl.dropboxusercontent.com/u/47675/jar_thing/%s", file),
|
"artifact_source": fmt.Sprintf("https://dl.dropboxusercontent.com/u/47675/jar_thing/%s", file),
|
||||||
"command": filepath.Join("$NOMAD_TASK_DIR", file),
|
"command": filepath.Join("$NOMAD_TASK_DIR", file),
|
||||||
|
"checksum": checksum,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
driverCtx := testDriverContext(task.Name)
|
driverCtx := testDriverContext(task.Name)
|
||||||
|
|
Loading…
Reference in a new issue