Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate apt::pin for apt::backports to allow pin by release instead … #558

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion manifests/backports.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@
}
}

apt::pin { 'backports':
before => Apt::Source['backports'],
release => $_release,
priority => $pin,
}

apt::source { 'backports':
location => $_location,
release => $_release,
repos => $_repos,
key => $_key,
pin => $pin,
}

}
45 changes: 39 additions & 6 deletions spec/classes/apt_backports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
:key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
:repos => 'main contrib non-free',
:release => 'wheezy-backports',
:pin => 200,
})
}

it { should contain_apt__pin('backports').with({
'release' => 'wheezy-backports',
'priority' => 200,
})
}
end
Expand All @@ -36,7 +41,12 @@
:key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
:repos => 'main contrib non-free',
:release => 'squeeze-backports',
:pin => 200,
})
}

it { should contain_apt__pin('backports').with({
'release' => 'squeeze-backports',
'priority' => 200,
})
}
end
Expand All @@ -54,7 +64,13 @@
:key => '630239CC130E1A7FD81A27B140976EAF437D05B5',
:repos => 'main universe multiverse restricted',
:release => 'trusty-backports',
:pin => 200,
})
}

it { should contain_apt__pin('backports').with({
'release' => 'trusty-backports',
'priority' => 200,

})
}
end
Expand All @@ -81,7 +97,13 @@
:key => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
:repos => 'main',
:release => 'vivid',
:pin => 90,
})
}

it { should contain_apt__pin('backports').with({
'release' => 'vivid',
'priority' => 90,

})
}
end
Expand All @@ -106,7 +128,12 @@
end
it { is_expected.to contain_apt__source('backports').with({
:key => { 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' },
:pin => { 'priority' => '90' },
})
}

it { should contain_apt__pin('backports').with({
'release' => 'trusty-backports',
#'priority' => '90', # TODO FIXME Produces error 'expected that the catalogue would contain Apt::Pin[backports] with priority set to "90" but it is set to {"priority"=>"90"}' ;(
})
}
end
Expand Down Expand Up @@ -134,7 +161,13 @@
:key => '630239CC130E1A7FD81A27B140976EAF437D05B5',
:repos => 'main universe multiverse restricted',
:release => 'trusty-backports',
:pin => 200,
})
}

it { should contain_apt__pin('backports').with({
'release' => 'trusty-backports',
'priority' => 200,

})
}
end
Expand Down