Skip to content

Commit

Permalink
rename acceptance test and update travis.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Wright <[email protected]>
  • Loading branch information
Patrick Wright committed Aug 31, 2017
1 parent 59d5031 commit 25597e1
Show file tree
Hide file tree
Showing 33 changed files with 169 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ matrix:
env: SUITE=ubuntu
- rvm: 2.3
env: SUITE=windows-server
- rvm: 2.3
env: SUITE=centos

before_script:
- ci/before-script.sh
Expand Down
1 change: 1 addition & 0 deletions acceptance/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/Gemfile.lock
/.acceptance_data/
/.suites/

# Terraform
*.tfstate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Uncomment when re-running for local development
describe command("sudo rm -rf /tmp/metadata /tmp/checksum /tmp/bad; sudo dpkg -r chef") do
its('exit_status') { should eq 0 }
its("exit_status") { should eq 0 }
end


#
# DOWNLOAD URL TESTS
#
Expand Down Expand Up @@ -32,7 +31,7 @@

# Corrupt the file we just downloaded
describe command("sudo chown ubuntu /tmp/checksum; sudo chown ubuntu /tmp/checksum/*; for i in /tmp/checksum/*; do echo 'oops'>>$i; done;") do
its('exit_status') { should eq 0 }
its("exit_status") { should eq 0 }
end

# Run with checksum and it should download and re-verify the checksum
Expand All @@ -48,7 +47,6 @@
its("stdout") { should match /Removing chef/ }
end


#
# METADATA URL TESTS
#
Expand All @@ -69,13 +67,12 @@
its("stdout") { should match /Removing chef/ }
end


#
# DOWNLOAD URL BAD CHECKSUM TESTS
#
describe command("sudo /tmp/install_bad.sh") do
its("stdout") { should match /Download URL override specified/ }
its("stdout") { should match /tmp\/bad\/chef.* not found/ }
its("stdout") { should match /Package checksum mismatch/ }
its('exit_status') { should eq 1 }
its("exit_status") { should eq 1 }
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 3,
"terraform_version": "0.9.2",
"serial": 49,
"lineage": "56ba621c-ff22-4b46-9e39-b5caa54d1f6c",
"modules": [
{
"path": [
"root"
],
"outputs": {},
"resources": {},
"depends_on": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"version": 3,
"terraform_version": "0.9.2",
"serial": 48,
"lineage": "56ba621c-ff22-4b46-9e39-b5caa54d1f6c",
"modules": [
{
"path": [
"root"
],
"outputs": {},
"resources": {
"aws_instance.mixlib_install_sh": {
"type": "aws_instance",
"depends_on": [
"data.aws_ami.ubuntu_14_ami"
],
"primary": {
"id": "i-067d7859e45154ec2",
"attributes": {
"ami": "ami-7d41ad05",
"associate_public_ip_address": "true",
"availability_zone": "us-west-2a",
"disable_api_termination": "false",
"ebs_block_device.#": "0",
"ebs_optimized": "false",
"ephemeral_block_device.#": "0",
"iam_instance_profile": "",
"id": "i-067d7859e45154ec2",
"instance_state": "running",
"instance_type": "t2.micro",
"ipv6_address_count": "0",
"ipv6_addresses.#": "0",
"key_name": "es-infrastructure",
"monitoring": "false",
"network_interface_id": "eni-915042be",
"private_dns": "ip-10-194-16-225.us-west-2.compute.internal",
"private_ip": "10.194.16.225",
"public_dns": "ec2-35-161-15-10.us-west-2.compute.amazonaws.com",
"public_ip": "35.161.15.10",
"root_block_device.#": "1",
"root_block_device.0.delete_on_termination": "true",
"root_block_device.0.iops": "0",
"root_block_device.0.volume_size": "8",
"root_block_device.0.volume_type": "standard",
"security_groups.#": "0",
"source_dest_check": "false",
"subnet_id": "subnet-11ac0174",
"tags.%": "5",
"tags.X-Application": "mixlib-install",
"tags.X-Contact": "pwright",
"tags.X-Dept": "EngServ",
"tags.X-Environment": "acceptance",
"tags.X-Production": "false",
"tenancy": "default",
"vpc_security_group_ids.#": "1",
"vpc_security_group_ids.4251682363": "sg-96274af3"
},
"meta": {
"schema_version": "1"
},
"tainted": false
},
"deposed": [],
"provider": ""
},
"data.aws_ami.ubuntu_14_ami": {
"type": "aws_ami",
"depends_on": [],
"primary": {
"id": "ami-7d41ad05",
"attributes": {
"architecture": "x86_64",
"block_device_mappings.#": "3",
"block_device_mappings.1634610537.device_name": "/dev/sdb",
"block_device_mappings.1634610537.ebs.%": "0",
"block_device_mappings.1634610537.no_device": "",
"block_device_mappings.1634610537.virtual_name": "ephemeral0",
"block_device_mappings.3850042718.device_name": "/dev/sdc",
"block_device_mappings.3850042718.ebs.%": "0",
"block_device_mappings.3850042718.no_device": "",
"block_device_mappings.3850042718.virtual_name": "ephemeral1",
"block_device_mappings.4184906282.device_name": "/dev/sda1",
"block_device_mappings.4184906282.ebs.%": "6",
"block_device_mappings.4184906282.ebs.delete_on_termination": "true",
"block_device_mappings.4184906282.ebs.encrypted": "false",
"block_device_mappings.4184906282.ebs.iops": "0",
"block_device_mappings.4184906282.ebs.snapshot_id": "snap-0e39ccdbb062cc398",
"block_device_mappings.4184906282.ebs.volume_size": "8",
"block_device_mappings.4184906282.ebs.volume_type": "standard",
"block_device_mappings.4184906282.no_device": "",
"block_device_mappings.4184906282.virtual_name": "",
"creation_date": "2017-08-19T09:17:15.000Z",
"description": "Canonical, Ubuntu, 14.04 LTS, amd64 trusty image build on 2017-08-18",
"filter.#": "6",
"filter.1223336572.name": "name",
"filter.1223336572.values.#": "1",
"filter.1223336572.values.0": "ubuntu/images/*/ubuntu-*-14.04-*-server-*",
"filter.1297260861.name": "image-type",
"filter.1297260861.values.#": "1",
"filter.1297260861.values.0": "machine",
"filter.182921130.name": "block-device-mapping.volume-type",
"filter.182921130.values.#": "1",
"filter.182921130.values.0": "standard",
"filter.3386043752.name": "architecture",
"filter.3386043752.values.#": "1",
"filter.3386043752.values.0": "x86_64",
"filter.3841461918.name": "owner-id",
"filter.3841461918.values.#": "1",
"filter.3841461918.values.0": "099720109477",
"filter.490168357.name": "virtualization-type",
"filter.490168357.values.#": "1",
"filter.490168357.values.0": "hvm",
"hypervisor": "xen",
"id": "ami-7d41ad05",
"image_id": "ami-7d41ad05",
"image_location": "099720109477/ubuntu/images/hvm/ubuntu-trusty-14.04-amd64-server-20170818",
"image_type": "machine",
"most_recent": "true",
"name": "ubuntu/images/hvm/ubuntu-trusty-14.04-amd64-server-20170818",
"owner_id": "099720109477",
"product_codes.#": "0",
"public": "true",
"root_device_name": "/dev/sda1",
"root_device_type": "ebs",
"sriov_net_support": "simple",
"state": "available",
"state_reason.%": "2",
"state_reason.code": "UNSET",
"state_reason.message": "UNSET",
"tags.#": "0",
"virtualization_type": "hvm"
},
"meta": {},
"tainted": false
},
"deposed": [],
"provider": ""
}
},
"depends_on": []
}
]
}
File renamed without changes.
File renamed without changes.
9 changes: 3 additions & 6 deletions acceptance/centos_install_checksum/inspec/verify.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Uncomment when re-running for local development
describe command("sudo rm -rf /tmp/metadata /tmp/checksum /tmp/bad; sudo yum remove chef -y") do
its('exit_status') { should eq 0 }
its("exit_status") { should eq 0 }
end


#
# DOWNLOAD URL TESTS
#
Expand Down Expand Up @@ -32,7 +31,7 @@

# Corrupt the file we just downloaded
describe command("sudo chown centos /tmp/checksum; sudo chown centos /tmp/checksum/*; for i in /tmp/checksum/*; do echo 'oops'>>$i; done;") do
its('exit_status') { should eq 0 }
its("exit_status") { should eq 0 }
end

# Run with checksum and it should download and re-verify the checksum
Expand All @@ -48,7 +47,6 @@
its("stdout") { should match /Complete!/ }
end


#
# METADATA URL TESTS
#
Expand All @@ -69,13 +67,12 @@
its("stdout") { should match /Complete!/ }
end


#
# DOWNLOAD URL BAD CHECKSUM TESTS
#
describe command("sudo /tmp/install_bad.sh") do
its("stdout") { should match /Download URL override specified/ }
its("stdout") { should match /tmp\/bad\/chef.* not found/ }
its("stdout") { should match /Package checksum mismatch/ }
its('exit_status') { should eq 1 }
its("exit_status") { should eq 1 }
end

0 comments on commit 25597e1

Please sign in to comment.