-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #403 from toddr/beta
Add command line arg to use the leapp beta repos
- Loading branch information
Showing
9 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/local/cpanel/3rdparty/bin/perl | ||
|
||
# HARNESS-NO-STREAM | ||
|
||
use cPstrict; | ||
use FindBin; | ||
|
||
use Test2::V0; | ||
use Test2::Tools::Explain; | ||
use Test2::Plugin::NoWarnings; | ||
use Test2::Tools::Exception; | ||
|
||
use Test::MockModule qw/strict/; | ||
|
||
use lib $FindBin::Bin . "/lib"; | ||
use Test::Elevate; | ||
|
||
use cPstrict; | ||
|
||
$INC{'scripts/ElevateCpanel.pm'} = '__TEST__'; | ||
|
||
my @ssystem_cmds; | ||
my $leappbeta = 1; | ||
my $mock_elevate = Test::MockModule->new('cpev'); | ||
$mock_elevate->redefine( | ||
ssystem_and_die => sub ( $, @args ) { | ||
|
||
push @ssystem_cmds, [@args]; | ||
note "run: " . join( " ", @args ); | ||
|
||
return; | ||
}, | ||
getopt => sub ( $, $opt ) { return $leappbeta if $opt && $opt eq 'leappbeta' }, | ||
); | ||
|
||
my $cpev = bless( {}, 'cpev' ); | ||
my $self = Elevate::Leapp->new( 'cpev' => $cpev ); | ||
|
||
set_os_to_cloudlinux_7(); | ||
is( $self->beta_if_enabled, 1, "beta_if_enabled when enabled" ); | ||
is( \@ssystem_cmds, [ [qw{/usr/bin/yum-config-manager --disable elevate}], [qw{/usr/bin/yum-config-manager --enable elevate-updates-testing}] ], "Expected commands are run to setup the repos." ) | ||
or diag explain \@ssystem_cmds; | ||
|
||
$leappbeta = 0; | ||
@ssystem_cmds = (); | ||
is( $self->beta_if_enabled, undef, "beta_if_enabled when disabled" ); | ||
is( \@ssystem_cmds, [], "No commands are run to setup the repos." ); | ||
|
||
done_testing; |