Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example for pairwise test generation
# execute via rspec -fd pairwise_spec.rb
# for more info see http://atodorov.org/blog/2017/04/14/testing-red-hat-enterprise-linux-the-microsoft-way/
require 'pairwise'
describe "RHEL 6.9 Tier #2 and #3 testing" do
context "Test case w/o parameters can't be reduced via pairwise" do
[
[%w(x86_64), %w(Server Workstation Client ComputeNode)],
[%w(i386), %w(Server Workstation Client)],
[%w(ppc64 s390x), %w(Server)]
].each do |arch, variant|
# generate pairwise combinations for tests with variations
Pairwise.combinations(
['partitioning / swap on LVM'],
arch,
variant
).each do |(base_test_case, arch, variant)|
it "#{arch} #{variant} - #{base_test_case}" do end
end
end
end
context "Test case(s) with parameters can be reduced by pairwise" do
[
[%w(x86_64), %w(Server Workstation Client ComputeNode)],
[%w(i386), %w(Server Workstation Client)],
[%w(ppc64 s390x), %w(Server)]
].each do |arch, variant|
# generate pairwise combinations for tests with variations
Pairwise.combinations(
['rescue mode'],
%w(LVM RAID),
%w(plain encrypted),
arch,
variant
).each do |(base_test_case, partition_type, encryption, arch, variant)|
it "#{arch} #{variant} - #{base_test_case} / #{partition_type} / #{encryption}" do end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment