Skip to content

Commit

Permalink
regression in unit tests - environment outdated since 3.9.2-45 rockst…
Browse files Browse the repository at this point in the history
…or#1993

Adds previously omitted python imports and associated settings to
template file test-settings.conf.in. These same changes were
previously only applied to the non testing environment template file
settings.conf.in.

Fixes test_btrfs* runs.
  • Loading branch information
phillxnet committed Nov 23, 2018
1 parent 33917f1 commit d58d8f2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion conf/test-settings.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

# Django settings for Rockstor project.
import os
import subprocess, distro

DEBUG = ${django-settings-conf:debug}
TEMPLATE_DEBUG = DEBUG
Expand Down Expand Up @@ -384,4 +385,23 @@ UPDATE_CHANNELS = {
'description': 'Subscription channel for testing updates',
'url': 'rockstor.com/rockrepo-testing',
},
}
}

# Setup OS specific command paths via 'which cmd' calls
# N.B. this method will not work with an alias, ie in CentOS
# which ls
# alias ls='ls --color=auto'
# /usr/bin/ls
# The following have been tested in CentOS, openSUSE Leap15, and Tumbleweed
UDEVADM = subprocess.check_output(["which", "udevadm"]).rstrip()
SHUTDOWN = subprocess.check_output(["which", "shutdown"]).rstrip()
CHKCONFIG_BIN = subprocess.check_output(["which", "chkconfig"]).rstrip()

# Establish our OS base id, name, and version:
# Use id for code path decisions. Others are for Web-UI display purposes.
# Examples given are for CentOS Rockstor variant, Leap 15, and Tumblweed.
OS_DISTRO_ID = distro.id() # rockstor, opensuse-leap, opensuse-tumbleweed
OS_DISTRO_NAME = distro.name() # Rockstor, openSUSE Leap, openSUSE Tumbleweed
# Note that the following will capture the build os version.
# For live updates (running system) we call distro.version() directly in code.
OS_DISTRO_VERSION = distro.version() # 3, 15.0 ,20181107

0 comments on commit d58d8f2

Please sign in to comment.