summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/helper.pm5
-rw-r--r--t/superuser--file-conflicts.t36
-rw-r--r--t/superuser--media_info_dir.t5
-rw-r--r--t/superuser--rpm.t1
-rw-r--r--t/superuser--rpmnew.t9
5 files changed, 41 insertions, 15 deletions
diff --git a/t/helper.pm b/t/helper.pm
index d7880b73..210aadd6 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -8,6 +8,7 @@ our @EXPORT = qw(need_root_and_prepare
urpm_cmd urpmi_cmd urpmi urpme
urpmi_cfg set_urpmi_cfg_global_options
system_ system_should_fail
+ rpm_is_jbj_version
check_installed_fullnames check_installed_names check_nothing_installed
check_installed_and_remove check_installed_fullnames_and_remove check_installed_and_urpme
);
@@ -96,6 +97,10 @@ sub system_should_fail {
ok($? != 0, "should fail: $cmd");
}
+sub rpm_is_jbj_version {
+ # checking for --yaml support
+ `rpm --help` =~ /yaml/;
+}
sub check_installed_fullnames {
my (@names) = @_;
diff --git a/t/superuser--file-conflicts.t b/t/superuser--file-conflicts.t
index 4fade655..d3fcf03b 100644
--- a/t/superuser--file-conflicts.t
+++ b/t/superuser--file-conflicts.t
@@ -30,9 +30,12 @@ test_urpmi_same_transaction();
test_urpmi_different_transactions();
sub test_rpm_same_transaction {
- # ERROR: disabled, fail (#32528)
- #test_rpm_i_fail('a', 'b');
- #check_nothing_installed();
+ if (rpm_is_jbj_version()) {
+ # ERROR: disabled, fail (#32528)
+ } else {
+ test_rpm_i_fail('a', 'b');
+ check_nothing_installed();
+ }
test_rpm_i_succeeds('a', 'c');
check_installed_and_remove('a', 'c');
@@ -40,9 +43,12 @@ sub test_rpm_same_transaction {
test_rpm_i_succeeds('a', 'd');
check_installed_and_remove('a', 'd');
- # ERROR: disabled, fail (#32528)
- #test_rpm_i_fail('a', 'e');
- #check_nothing_installed();
+ if (rpm_is_jbj_version()) {
+ # ERROR: disabled, fail (#32528)
+ } else {
+ test_rpm_i_fail('a', 'e');
+ check_nothing_installed();
+ }
}
sub test_rpm_different_transactions {
@@ -80,9 +86,12 @@ sub test_rpm_different_transactions {
}
sub test_urpmi_same_transaction {
- # ERROR: disabled, fail (#32528)
- #test_urpmi_fail('a', 'b');
- #check_nothing_installed();
+ if (rpm_is_jbj_version()) {
+ # ERROR: disabled, fail (#32528)
+ } else {
+ test_urpmi_fail('a b');
+ check_nothing_installed();
+ }
urpmi('a c');
check_installed_and_remove('a', 'c');
@@ -90,9 +99,12 @@ sub test_urpmi_same_transaction {
urpmi('a d');
check_installed_and_remove('a', 'd');
- # ERROR: disabled, fail (#32528)
- #urpmi('a e');
- #check_installed_and_remove('a', 'e');
+ if (rpm_is_jbj_version()) {
+ # ERROR: disabled, fail (#32528)
+ } else {
+ test_urpmi_fail('a e');
+ check_nothing_installed();
+ }
}
sub test_urpmi_different_transactions {
diff --git a/t/superuser--media_info_dir.t b/t/superuser--media_info_dir.t
index 7d2a18d2..2173014c 100644
--- a/t/superuser--media_info_dir.t
+++ b/t/superuser--media_info_dir.t
@@ -46,7 +46,10 @@ sub rpm_v3 {
chomp(my $fullname = `$cmd`);
my ($arch) = $fullname =~ /(\w+)$/;
- $wanted_arch = 'i386' if $src_rpm =~ /KBackup/; # WARNING: package has a Sourcerpm empty tag (#29809), but this package is broken anyway
+ if (rpm_is_jbj_version()) {
+ # WARNING: package has a Sourcerpm empty tag (#29809), but this package is broken anyway
+ $wanted_arch = 'i386' if $src_rpm =~ /KBackup/;
+ }
is($arch, $wanted_arch, "$fullname should have arch $wanted_arch (found $arch)");
}
diff --git a/t/superuser--rpm.t b/t/superuser--rpm.t
index 4930d30d..eb21355d 100644
--- a/t/superuser--rpm.t
+++ b/t/superuser--rpm.t
@@ -8,6 +8,7 @@ use Test::More 'no_plan';
my $name = 'rpm-query-in-scriptlet';
need_root_and_prepare();
+rpm_is_jbj_version() or system_('mkdir -p root/var/lib/rpm');
test_rpm_query_in_scriptlet();
sub test_rpm_query_in_scriptlet {
diff --git a/t/superuser--rpmnew.t b/t/superuser--rpmnew.t
index 8c71b02c..4aa530e7 100644
--- a/t/superuser--rpmnew.t
+++ b/t/superuser--rpmnew.t
@@ -43,8 +43,13 @@ sub test2 {
['orig', 'orig', 'orig'],
['changed', 'changed', 'changed']);
- ok(unlink "$::pwd/root/etc/config.rpmorig");
- ok(unlink "$::pwd/root/etc/config-noreplace.rpmnew");
+ if (rpm_is_jbj_version()) {
+ #- WARNING: those files have no added value
+ #- (since the file was created with same content)
+ #- and should not be there
+ ok(unlink "$::pwd/root/etc/config.rpmorig");
+ ok(unlink "$::pwd/root/etc/config-noreplace.rpmnew");
+ }
check_no_etc_files();
}