From 94183c05f962e39c18ed56ce083124a0327a8284 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 30 Apr 2007 13:37:54 +0000 Subject: add a simple test case on split transactions --- t/superuser--split-transactions.t | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 t/superuser--split-transactions.t (limited to 't/superuser--split-transactions.t') diff --git a/t/superuser--split-transactions.t b/t/superuser--split-transactions.t new file mode 100644 index 00000000..1f1c54b6 --- /dev/null +++ b/t/superuser--split-transactions.t @@ -0,0 +1,40 @@ +#!/usr/bin/perl + +# packages "a" and "b" require each other, and so must installed in same transaction +# package "c" requires "a" and can be installed later on +# package "d" has no deps and can be installed alone in its transaction, with no particular timing +use strict; +use lib '.', 't'; +use helper; +use Expect; +use urpm::util; +use Test::More 'no_plan'; + +need_root_and_prepare(); + +my $name = 'split-transactions'; +urpmi_addmedia("$name $::pwd/media/$name"); + +test_urpmi("--auto --split-level 1 c d", <<'EOF'); +Preparing... + 1/4: a + 2/4: b +Preparing... + 3/4: c +Preparing... + 4/4: d +EOF +check_installed_names('a', 'b', 'c', 'd'); + +sub test_urpmi { + my ($para, $wanted) = @_; + my $urpmi = urpmi_cmd(); + my $s = `$urpmi $para`; + print $s; + + $s =~ s/\s*#{40}#*//g; + $s =~ s/^installing .*//gm; + $s =~ s/^\n//gm; + + ok($s eq $wanted, "$wanted in $s"); +} -- cgit v1.2.1