user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
cf34c7ae11074dd61122bc385c7c5bcf20dae736 blob 968 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
#!perl -w
# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict; use v5.10.1; use PublicInbox::TestCommon;
my $sock = tcp_server();
my ($tmpdir, $for_destroy) = tmpdir();
my $http = 'http://'.$sock->sockhost.':'.$sock->sockport.'/';
my ($ro_home, $cfg_path) = setup_public_inboxes;
my $cmd = [ qw(-httpd -W0), "--stdout=$tmpdir/out", "--stderr=$tmpdir/err" ];
my $td = start_script($cmd, { PI_CONFIG => $cfg_path }, { 3 => $sock });
test_lei({ tmpdir => $tmpdir }, sub {
	my $home = $ENV{HOME};
	my $t1 = "$home/t1-mirror";
	ok($lei->('add-external', $t1, '--mirror', "$http/t1/"), '--mirror v1');
	ok(-f "$t1/public-inbox/msgmap.sqlite3", 't1-mirror indexed');
	my $t2 = "$home/t2-mirror";
	ok($lei->('add-external', $t2, '--mirror', "$http/t2/"), '--mirror v2');
	ok(-f "$t2/msgmap.sqlite3", 't2-mirror indexed');
});

ok($td->kill, 'killed -httpd');
$td->join;

done_testing;
debug log:

solving cf34c7ae ...
found cf34c7ae in public-inbox.git.git

Code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).