Jira (FACT-3050) EC2 resolver failing with ruby 2.3.8p459 when token is nil

0 views
Skip to first unread message

Luchian Nemes (Jira)

unread,
Jun 8, 2021, 5:29:02 AM6/8/21
to puppe...@googlegroups.com
Luchian Nemes created an issue
 
Facter / Bug FACT-3050
EC2 resolver failing with ruby 2.3.8p459 when token is nil
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/06/08 2:28 AM
Priority: Normal Normal
Reporter: Luchian Nemes

Running rspec tests using bundle exec rspec --seed 49031 -fd on a Ubuntu vm with ruby 2.3.8p459 fails with following errors:

Failures:
 
  1) Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths returns userdata
     Failure/Error: expect(ec2.resolve(:userdata)).to eql('userdata')
 
       expected: "userdata"
            got: ""
 
       (compared using eql?)
     Shared Example Group: "ec2" called from ./spec/facter/resolvers/ec2_spec.rb:134
     # ./spec/facter/resolvers/ec2_spec.rb:51:in `block (4 levels) in <top (required)>'
 
  2) Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths parses ec2 network/ directory as a multi-level hash
     Failure/Error: expect(ec2.resolve(:metadata)).to match(hash_including(network_hash))
 
       expected {} to match #<RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher:0x000055664e84a1c0 @expected={"network"=>{"interfaces"=>{"macs"=>{"12:34:56:78:9a:bc"=>{"accountId"=>"41234"}}}}}>
       Diff:
       @@ -1,5 +1 @@
       -#<RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher:0x000055664e84a1c0
       - @expected=
       -  {"network"=>
       -    {"interfaces"=>{"macs"=>{"12:34:56:78:9a:bc"=>{"accountId"=>"41234"}}}}}>
     Shared Example Group: "ec2" called from ./spec/facter/resolvers/ec2_spec.rb:134
     # ./spec/facter/resolvers/ec2_spec.rb:83:in `block (4 levels) in <top (required)>'
 
  3) Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths fetches the available data
     Failure/Error:
       expect(ec2.resolve(:metadata)).to match(
         {
           'instance_type' => '',
           'ami_id' => 'ami-5d2dc934',
           'security-groups' => "group1\ngroup2"
         }
       )
 
       expected {} to match {"instance_type"=>"", "ami_id"=>"ami-5d2dc934", "security-groups"=>"group1\ngroup2"}
       Diff:
       @@ -1,4 +1 @@
       -"ami_id" => "ami-5d2dc934",
       -"instance_type" => "",
       -"security-groups" => "group1\ngroup2",
     Shared Example Group: "ec2" called from ./spec/facter/resolvers/ec2_spec.rb:134
     # ./spec/facter/resolvers/ec2_spec.rb:89:in `block (4 levels) in <top (required)>'
 
  4) Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths recursively fetches all the ec2 metadata
     Failure/Error:
       expect(ec2.resolve(:metadata)).to match(
         {
           'instance_type' => 'c1.medium',
           'ami_id' => 'ami-5d2dc934',
           'security-groups' => "group1\ngroup2"
         }
       )
 
       expected {} to match {"instance_type"=>"c1.medium", "ami_id"=>"ami-5d2dc934", "security-groups"=>"group1\ngroup2"}
       Diff:
       @@ -1,4 +1 @@
       -"ami_id" => "ami-5d2dc934",
       -"instance_type" => "c1.medium",
       -"security-groups" => "group1\ngroup2",
     Shared Example Group: "ec2" called from ./spec/facter/resolvers/ec2_spec.rb:134
     # ./spec/facter/resolvers/ec2_spec.rb:41:in `block (4 levels) in <top (required)>'
 
Finished in 3.76 seconds (files took 1.74 seconds to load)
3548 examples, 4 failures
 
Failed examples:
 
rspec './spec/facter/resolvers/ec2_spec.rb[1:2:1:1:2]' # Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths returns userdata
rspec './spec/facter/resolvers/ec2_spec.rb[1:2:1:1:3]' # Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths parses ec2 network/ directory as a multi-level hash
rspec './spec/facter/resolvers/ec2_spec.rb[1:2:1:1:4]' # Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths fetches the available data
rspec './spec/facter/resolvers/ec2_spec.rb[1:2:1:1:1]' # Facter::Resolvers::Ec2 when IMDSv1 behaves like ec2 with common metadata paths recursively fetches all the ec2 metadata

GitHub Actions job example: https://github.com/puppetlabs/facter/runs/2764167003?check_suite_focus=true

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Gheorghe Popescu (Jira)

unread,
Jun 9, 2021, 3:23:02 AM6/9/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 9, 2021, 10:05:01 AM6/9/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 9, 2021, 10:05:02 AM6/9/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Jun 16, 2021, 3:46:03 AM6/16/21
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Jun 16, 2021, 3:50:01 AM6/16/21
to puppe...@googlegroups.com

Christine Yoon (Jira)

unread,
Jun 21, 2021, 10:20:02 AM6/21/21
to puppe...@googlegroups.com

Christine Yoon (Jira)

unread,
Jun 21, 2021, 2:27:02 PM6/21/21
to puppe...@googlegroups.com
Christine Yoon updated an issue
Change By: Christine Yoon
Labels: doc_reviewed docs-reviewed
Reply all
Reply to author
Forward
0 new messages