summaryrefslogtreecommitdiff
path: root/test/dup-test
blob: b073cee29bacdc8f8f92a3eca808ac3f25fe98fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl

use FS::UID qw(adminsuidsetup);
use FS::svc_acct;

my $user = 'ivan';
my $svcpart = '2';

my $counter = 10;

my $pid = open(KID_TO_WRITE, "-|");

if ( $pid ) { #parent
  doit();
} else { #kid
  doit();
  exit;
}

sub doit {

  adminsuidsetup $user or die;

  my $svc_acct = new FS::svc_acct ( {
    'svcpart' => $svcpart,
    'username' => "dup$counter",
  } );
  my $error = $svc_acct->insert;
  warn $error if $error;

}