Merge pull request #4907 from WeatherGod/invalid_json_test

test that parsing fails on a certain kind of malformed JSON
This commit is contained in:
Matthew Hooker 2017-05-19 13:54:05 -07:00 committed by GitHub
commit 932c4715e7
2 changed files with 26 additions and 0 deletions

View File

@ -359,6 +359,7 @@ func TestParse_bad(t *testing.T) {
{"error-beginning.json", "line 1, column 1 (offset 1)"},
{"error-middle.json", "line 5, column 6 (offset 50)"},
{"error-end.json", "line 1, column 30 (offset 30)"},
{"malformed.json", "line 16, column 3 (offset 433)"},
}
for _, tc := range cases {
_, err := ParseFile(fixtureDir(tc.File))

View File

@ -0,0 +1,25 @@
{
"variables": {
"access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `access_key`}}",
"secret_key": "{{user `secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-fce3c696,",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-example {{timestamp}}"
}]
}]
"provisioners": [{
"type": "shell",
"inline": [
"sleep 15",
"sudo yum update -y"
]
}]
}