spec/lib/packaging/config_spec.rb in packaging-0.99.76 vs spec/lib/packaging/config_spec.rb in packaging-0.99.77

- old
+ new

@@ -200,30 +200,28 @@ end end describe "#platform_data" do platform_tags = [ - 'eos-4-i386', 'osx-10.15-x86_64', - 'cisco-wrlinux-7-x86_64', + 'osx-11-x86_64', 'ubuntu-16.04-i386', 'el-6-x86_64', 'el-7-ppc64le', 'sles-12-x86_64', ] artifacts = \ - "./artifacts/eos/4/PC1/i386/puppet-agent-5.3.2-1.eos4.i386.swix\n" \ "./artifacts/apple/10.15/PC1/x86_64/puppet-agent-5.3.2.658.gc79ef9a-1.osx10.15.dmg\n" \ - "./artifacts/cisco-wrlinux/7/PC1/x86_64/puppet-agent-5.3.2-1.cisco_wrlinux7.x86_64.rpm\n" \ + "./artifacts/apple/11/PC1/x86_64/puppet-agent-5.3.2.658.gc79ef9a-1.osx11.dmg\n" \ "./artifacts/deb/xenial/PC1/puppet-agent_5.3.2-1xenial_i386.deb\n" \ "./artifacts/el/6/PC1/x86_64/puppet-agent-5.3.2.658.gc79ef9a-1.el6.x86_64.rpm\n" \ "./artifacts/el/7/PC1/ppc64le/puppet-agent-5.3.2-1.el7.ppc64le.rpm\n" \ "./artifacts/sles/12/PC1/x86_64/puppet-agent-5.3.2-1.sles12.x86_64.rpm" aix_artifacts = \ - "./artifacts/aix/6.1/PC1/ppc/puppet-agent-5.3.2-1.aix6.1.ppc.rpm" + "./artifacts/aix/7.1/PC1/ppc/puppet-agent-5.3.2-1.aix7.1.ppc.rpm" fedora_artifacts = \ "./artifacts/fedora/31/PC1/x86_64/puppet-agent-5.3.2-1.fc31.x86_64.rpm" windows_artifacts = \ @@ -257,11 +255,11 @@ allow(Pkg::Config).to receive(:ref).and_return(ref) allow(Pkg::Util::Net).to receive(:check_host_ssh).and_return([]) end it "should return a hash mapping platform tags to paths" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(artifacts, nil) expect(Pkg::Config.platform_data.keys).to eql(platform_tags) end it "should return nil if project isn't set" do allow(Pkg::Config).to receive(:project).and_return(nil) @@ -277,56 +275,56 @@ allow(Pkg::Util::Net).to receive(:check_host_ssh).and_return(['something']) expect(Pkg::Config.platform_data).to be_nil end it "should not use 'f' in fedora platform tags" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(fedora_artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(fedora_artifacts, nil) data = Pkg::Config.platform_data expect(data).to include('fedora-31-x86_64') expect(data).not_to include('fedora-f31-x86_64') end it "should collect packages whose extname differ from package_format" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(solaris_artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(solaris_artifacts, nil) data = Pkg::Config.platform_data expect(data).to include('solaris-10-i386' => {:artifact => './solaris/10/PC1/puppet-agent-5.3.2-1.i386.pkg.gz', :repo_config => nil}) expect(data).to include('solaris-11-sparc' => {:artifact => './solaris/11/PC1/puppet-agent@5.3.2,5.11-1.sparc.p5p', :repo_config => nil}) end it "should collect versioned msis" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(windows_artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(windows_artifacts, nil) data = Pkg::Config.platform_data expect(data['windows-2012-x86']).to include(:artifact => './windows/puppet-agent-5.3.2-x86.msi') expect(data['windows-2012-x64']).to include(:artifact => './windows/puppet-agent-5.3.2-x64.msi') expect(data['windowsfips-2012-x64']).to include(:artifact => './windowsfips/puppet-agent-5.3.2-x64.msi') end it "should not collect debug packages" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(stretch_artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(stretch_artifacts, nil) data = Pkg::Config.platform_data expect(data['debian-9-amd64']).to include(:artifact => './deb/stretch/PC1/puppet-agent_5.3.2.658.gc79ef9a-1stretch_amd64.deb') end it "should collect packages that don't match the project name" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(artifacts_not_matching_project, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(artifacts_not_matching_project, nil) data = Pkg::Config.platform_data expect(data['ubuntu-16.04-amd64']).to include(:artifact => './deb/xenial/pe-postgresql-contrib_2019.1.9.6.12-1xenial_amd64.deb') expect(data['ubuntu-16.04-amd64'][:additional_artifacts].size).to eq(3) expect(data['ubuntu-16.04-amd64'][:additional_artifacts]).to include('./deb/xenial/pe-postgresql-devel_2019.1.9.6.12-1xenial_amd64.deb') expect(data['ubuntu-16.04-amd64'][:additional_artifacts]).to include('./deb/xenial/pe-postgresql-server_2019.1.9.6.12-1xenial_amd64.deb') expect(data['ubuntu-16.04-amd64'][:additional_artifacts]).to include('./deb/xenial/pe-postgresql_2019.1.9.6.12-1xenial_amd64.deb') end it "should use 'ppc' instead of 'power' in aix paths" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(aix_artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(aix_artifacts, nil) data = Pkg::Config.platform_data - expect(data['aix-6.1-power']).to include(:artifact => './aix/6.1/PC1/ppc/puppet-agent-5.3.2-1.aix6.1.ppc.rpm') + expect(data['aix-7.1-power']).to include(:artifact => './aix/7.1/PC1/ppc/puppet-agent-5.3.2-1.aix7.1.ppc.rpm') end it "should not record an aix repo config" do - allow(Pkg::Util::Net).to receive(:remote_ssh_cmd).and_return(aix_artifacts, nil) + allow(Pkg::Util::Net).to receive(:remote_execute).and_return(aix_artifacts, nil) data = Pkg::Config.platform_data - expect(data['aix-6.1-power'][:repo_config]).to be_nil + expect(data['aix-7.1-power'][:repo_config]).to be_nil end end describe "#config_to_yaml" do it "should write a valid yaml file" do