Skip to content

Commit

Permalink
ovirt: Clean up install.sh
Browse files Browse the repository at this point in the history
The `install.sh` script no more relies on cockpit-ovirt installation
directory, so the `COCKPIT_DIR` variable is removed.

Closes #7905
  • Loading branch information
mareklibra authored and petervo committed Oct 20, 2017
1 parent e1f5bae commit 4c322e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 6 additions & 5 deletions pkg/ovirt/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@

ENGINE_FQDN=$1
ENGINE_PORT=$2
COCKPIT_DIR=${3:-/usr/share/cockpit} # TODO: get it dynamically via 'rpm -q cockpit-shell --fileprovide' or 'dpkg -L'

ETC_COCKPIT_DIR='/etc/cockpit'
VIRSH_CONNECTION_URI=$4 # optional

VIRSH_CONNECTION_URI=$3 # optional
VIRSH_CONNECTION_NAME='remote' # used if VIRSH_CONNECTION_URI is set

EXIT_PARAMS=1 # wrong command parameters
EXIT_NO_ACCESS_MACHINES_OVIRT_CONFIG=3 # can't write to /etc/cockpit/machines-ovirt.config, try as root

function usage() {
echo Usage: $0 '[ENGINE_FQDN] [ENGINE_PORT] [[COCKPIT_INSTLLATION_DIR]] [[VIRSH_CONNECTION_URI]]'
echo Usage: $0 '[ENGINE_FQDN] [ENGINE_PORT] [[VIRSH_CONNECTION_URI]]'
echo Example: $0 engine.mydomain.com 443
echo Example: $0 engine.mydomain.com 443
echo Example: $0 engine.mydomain.com 443 /usr/share/cockpit
echo Example: $0 engine.mydomain.com 443 /usr/share/cockpit qemu:///system
echo Example: $0 engine.mydomain.com 443 qemu:///system
}

function checkParams() {
Expand Down
7 changes: 4 additions & 3 deletions test/verify/check-ovirt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ VIRSH_CONNECTION_URI = "qemu+tcp://10.111.113.5/system"
OVIRT_USER = "admin@internal"
OVIRT_PWD = "engine"
CA_PEM_FILE = '/etc/pki/vdsm/certs/cacert.pem'
COCKPIT_DIR = '/usr/share/cockpit'
VDSM_CONF_FILE = '/etc/vdsm/vdsm.conf'

WAIT_SCRIPT = """
Expand Down Expand Up @@ -103,8 +102,10 @@ class TestOVirtMachines(MachineCase):
# In case of passing this initialization step via UI, a series of redirects (oVirt verification and authentication) would follow.
# The installation dialog calls 'ovirt/install.sh' script, so this simplification is acceptable for the test.
m = self.machine
m.execute("bash /usr/share/cockpit/ovirt/install.sh {0} {1} {2} {3}".format(ENGINE_FQDN, ENGINE_PORT, COCKPIT_DIR, VIRSH_CONNECTION_URI))
m.execute("sed -i 's/false/true/' /etc/cockpit/machines-ovirt.config") # turn on debug messages

m.execute("bash /usr/share/cockpit/ovirt/install.sh {0} {1} {2}".format(ENGINE_FQDN, ENGINE_PORT, VIRSH_CONNECTION_URI))
# m.execute("sed -i 's/false/true/' /etc/cockpit/machines-ovirt.config") # turn on debug messages

self.access_token = self.get_ovirt_token()

def get_ovirt_token(self):
Expand Down

0 comments on commit 4c322e6

Please sign in to comment.