This repository was archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathec_setup.ntest
53 lines (42 loc) · 1.63 KB
/
ec_setup.ntest
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*-Perl-*-
# ec_setup.ntest -
#
# Exercise the ec_setup script for the plugin.
#
# Copyright (c) 2005-2011 Electric Cloud, Inc.
# All rights reserved
use strict;
use warnings;
my $N = $::gCommander;
$N->login("admin", "changeme");
my $pluginKey = "EC-EC2";
my $xpath = $N->getPlugin($pluginKey);
my $pluginName = $xpath->findvalue("//pluginName")->value;
#-------------------------------------------------------------------------------
# Test permissions and visibility, which should be set regardless of whether the
# plugin is promoted or not.
#-------------------------------------------------------------------------------
ntest "install", {}, sub {
# Start out with the demoted plugin
assertOK($N->promotePlugin($pluginName, {promoted => 0}));
};
#-------------------------------------------------------------------------------
# Test promote & demote behavior.
#-------------------------------------------------------------------------------
ntest "promote", {}, sub {
# Start out with the demoted plugin
assertOK($N->promotePlugin($pluginName, {promoted => 0}));
# Make sure the plugin's ec_setup script exists
assertOK($xpath = $N->getProperty("/projects/$pluginName/ec_setup",
{expand => 0}),
"ec_setup property exists");
assertNe("", $xpath->findvalue("//value")->value,
"ec_setup script not empty");
# Promote the plugin
assertOK($N->promotePlugin($pluginName));
# Demote the plugin
assertOK($N->promotePlugin($pluginName, {promoted => 0}));
};
# Ensure the plugin is promoted for later tests.
$N->promotePlugin($pluginName);
1;