summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuya Kusakabe <yuya.kusakabe@gmail.com>2018-05-16 21:35:22 +0900
committerYuya Kusakabe <yuya.kusakabe@gmail.com>2018-05-16 21:35:22 +0900
commitbe6f809581ccbcd6411713128a63711eaa2ce6b7 (patch)
treec62377a36c274d878224dc102562fdfbc10e17be
parent99a3049c67005bf5e0ba45db264d56d3b57cb792 (diff)
downloadvyos-1x-be6f809581ccbcd6411713128a63711eaa2ce6b7.tar.gz
vyos-1x-be6f809581ccbcd6411713128a63711eaa2ce6b7.zip
Use '_' instead of '-' for python scripts for test
-rw-r--r--Makefile2
-rwxr-xr-xdebian/rules4
-rw-r--r--interface-definitions/bcast-relay.xml2
-rw-r--r--interface-definitions/cron.xml2
-rw-r--r--interface-definitions/dns-forwarding.xml2
-rw-r--r--interface-definitions/host-name.xml4
-rw-r--r--interface-definitions/mdns-repeater.xml2
-rw-r--r--interface-definitions/ntp.xml2
-rw-r--r--interface-definitions/ssh.xml2
-rw-r--r--op-mode-definitions/bandwidth-monitor.xml2
-rw-r--r--op-mode-definitions/dns-forwarding.xml4
-rw-r--r--op-mode-definitions/traffic-dump.xml2
-rw-r--r--op-mode-definitions/version.xml6
-rw-r--r--sonar-project.properties2
-rwxr-xr-xsrc/conf_mode/vyos_config_bcast_relay.py (renamed from src/conf-mode/vyos-config-bcast-relay.py)0
-rwxr-xr-xsrc/conf_mode/vyos_config_dns_forwarding.py (renamed from src/conf-mode/vyos-config-dns-forwarding.py)0
-rwxr-xr-xsrc/conf_mode/vyos_config_host_name.py (renamed from src/conf-mode/vyos-config-host-name.py)0
-rw-r--r--src/conf_mode/vyos_config_lldp.py (renamed from src/conf-mode/vyos-config-lldp.py)0
-rwxr-xr-xsrc/conf_mode/vyos_config_mdns_repeater.py (renamed from src/conf-mode/vyos-config-mdns-repeater.py)0
-rwxr-xr-xsrc/conf_mode/vyos_config_ntp.py (renamed from src/conf-mode/vyos-config-ntp.py)0
-rwxr-xr-xsrc/conf_mode/vyos_config_ssh.py (renamed from src/conf-mode/vyos-config-ssh.py)0
-rwxr-xr-xsrc/conf_mode/vyos_update_crontab.py (renamed from src/conf-mode/vyos-update-crontab.py)0
-rwxr-xr-xsrc/op_mode/vyos_dns_forwarding_statistics.py (renamed from src/op-mode/vyos-dns-forwarding-statistics.py)0
-rwxr-xr-xsrc/op_mode/vyos_list_dumpable_interfaces.py (renamed from src/op-mode/vyos-list-dumpable-interfaces.py)0
-rwxr-xr-xsrc/op_mode/vyos_list_interfaces.py (renamed from src/op-mode/vyos-list-interfaces.py)0
-rwxr-xr-xsrc/op_mode/vyos_restart_dns_forwarding.sh (renamed from src/op-mode/vyos-restart-dns-forwarding.sh)0
-rwxr-xr-xsrc/op_mode/vyos_show_version.py (renamed from src/op-mode/vyos-show-version.py)0
-rw-r--r--src/tests/test_vyos_update_crontab.py13
28 files changed, 25 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index 7da501f13..e90e3b640 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ clean:
.PHONY: test
test:
- python3 -m "nose" --with-xunit src --with-coverage --cover-erase --cover-xml --cover-package src/conf-mode,src/op-mode --verbose
+ python3 -m "nose" --with-xunit src --with-coverage --cover-erase --cover-xml --cover-package src/conf_mode,src/op_mode --verbose
.PHONY: sonar
sonar:
diff --git a/debian/rules b/debian/rules
index ed33706e4..3781a6f71 100755
--- a/debian/rules
+++ b/debian/rules
@@ -20,8 +20,8 @@ override_dh_auto_install:
# Install scripts
mkdir -p $(DIR)/$(VYOS_SBIN_DIR)
mkdir -p $(DIR)/$(VYOS_BIN_DIR)
- cp -r src/conf-mode/* $(DIR)/$(VYOS_SBIN_DIR)
- cp -r src/op-mode/* $(DIR)/$(VYOS_BIN_DIR)
+ cp -r src/conf_mode/* $(DIR)/$(VYOS_SBIN_DIR)
+ cp -r src/op_mode/* $(DIR)/$(VYOS_BIN_DIR)
# Install validators
mkdir -p $(DIR)/$(VYOS_LIBEXEC_DIR)/validators
diff --git a/interface-definitions/bcast-relay.xml b/interface-definitions/bcast-relay.xml
index 19f29e340..bacf771ac 100644
--- a/interface-definitions/bcast-relay.xml
+++ b/interface-definitions/bcast-relay.xml
@@ -10,7 +10,7 @@
<help>UDP Broadcast Relay parameters</help>
</properties>
<children>
- <tagNode name="id" owner="${vyos_sbindir}/vyos-config-bcast-relay.py">
+ <tagNode name="id" owner="${vyos_sbindir}/vyos-config_bcast_relay.py">
<properties>
<help>Unique ID for each UDP port to forward</help>
<valueHelp>
diff --git a/interface-definitions/cron.xml b/interface-definitions/cron.xml
index 65b95c5a4..fa2a589fa 100644
--- a/interface-definitions/cron.xml
+++ b/interface-definitions/cron.xml
@@ -10,7 +10,7 @@
<help>Task scheduler settings</help>
</properties>
<children>
- <tagNode name="task" owner="${vyos_sbindir}/vyos-update-crontab.py">
+ <tagNode name="task" owner="${vyos_sbindir}/vyos_update_crontab.py">
<properties>
<help>Scheduled task</help>
<valueHelp>
diff --git a/interface-definitions/dns-forwarding.xml b/interface-definitions/dns-forwarding.xml
index 60b90c6a7..73180b9a4 100644
--- a/interface-definitions/dns-forwarding.xml
+++ b/interface-definitions/dns-forwarding.xml
@@ -7,7 +7,7 @@
<children>
<node name="dns">
<children>
- <node name="forwarding" owner="${vyos_sbindir}/vyos-config-dns-forwarding.py">
+ <node name="forwarding" owner="${vyos_sbindir}/vyos_config_dns_forwarding.py">
<properties>
<help>DNS forwarding</help>
<priority>918</priority>
diff --git a/interface-definitions/host-name.xml b/interface-definitions/host-name.xml
index 4ab244f6a..7ccce89b4 100644
--- a/interface-definitions/host-name.xml
+++ b/interface-definitions/host-name.xml
@@ -5,7 +5,7 @@
<interfaceDefinition>
<node name="system">
<children>
- <leafNode name="host-name" owner="${vyos_sbindir}/vyos-config-host-name.py">
+ <leafNode name="host-name" owner="${vyos_sbindir}/vyos_config_host_name.py">
<properties>
<help>System host name (default: vyos)</help>
<constraint>
@@ -13,7 +13,7 @@
</constraint>
</properties>
</leafNode>
- <leafNode name="domain-name" owner="${vyos_sbindir}/vyos-config-host-name.py">
+ <leafNode name="domain-name" owner="${vyos_sbindir}/vyos_config_host_name.py">
<properties>
<help>System domain name</help>
<constraint>
diff --git a/interface-definitions/mdns-repeater.xml b/interface-definitions/mdns-repeater.xml
index e4898856b..82aa3235b 100644
--- a/interface-definitions/mdns-repeater.xml
+++ b/interface-definitions/mdns-repeater.xml
@@ -10,7 +10,7 @@
<help>Multicast DNS (mDNS) parameters</help>
</properties>
<children>
- <node name="repeater" owner="${vyos_sbindir}/vyos-config-mdns-repeater.py">
+ <node name="repeater" owner="${vyos_sbindir}/vyos_config_mdns_repeater.py">
<properties>
<help>mDNS repeater configuration</help>
<priority>990</priority>
diff --git a/interface-definitions/ntp.xml b/interface-definitions/ntp.xml
index e8cfc539c..311d61dbe 100644
--- a/interface-definitions/ntp.xml
+++ b/interface-definitions/ntp.xml
@@ -5,7 +5,7 @@
<interfaceDefinition>
<node name="system">
<children>
- <node name="ntp" owner="${vyos_sbindir}/vyos-config-ntp.py">
+ <node name="ntp" owner="${vyos_sbindir}/vyos_config_ntp.py">
<properties>
<help>Network Time Protocol (NTP) configuration</help>
<priority>400</priority>
diff --git a/interface-definitions/ssh.xml b/interface-definitions/ssh.xml
index dfae1d8ed..146aec6b6 100644
--- a/interface-definitions/ssh.xml
+++ b/interface-definitions/ssh.xml
@@ -5,7 +5,7 @@
<interfaceDefinition>
<node name="service">
<children>
- <node name="ssh" owner="${vyos_sbindir}/vyos-config-ssh.py">
+ <node name="ssh" owner="${vyos_sbindir}/vyos_config_ssh.py">
<properties>
<help>Secure SHell (SSH) protocol</help>
<priority>500</priority>
diff --git a/op-mode-definitions/bandwidth-monitor.xml b/op-mode-definitions/bandwidth-monitor.xml
index a6ddcfd4b..38d099613 100644
--- a/op-mode-definitions/bandwidth-monitor.xml
+++ b/op-mode-definitions/bandwidth-monitor.xml
@@ -12,7 +12,7 @@
<properties>
<help>Monitor bandwidth usage on specified interface</help>
<completionHelp>
- <script>${vyos_bindir}/vyos-list-interfaces.py</script>
+ <script>${vyos_bindir}/vyos_list_interfaces.py</script>
</completionHelp>
</properties>
</tagNode>
diff --git a/op-mode-definitions/dns-forwarding.xml b/op-mode-definitions/dns-forwarding.xml
index 96fa1a6f4..f3a618e31 100644
--- a/op-mode-definitions/dns-forwarding.xml
+++ b/op-mode-definitions/dns-forwarding.xml
@@ -14,7 +14,7 @@
<properties>
<help>Show DNS forwarding statistics</help>
</properties>
- <command>${vyos_bindir}/vyos-dns-forwarding-statistics.py</command>
+ <command>${vyos_bindir}/vyos_dns_forwarding_statistics.py</command>
</leafNode>
</children>
</node>
@@ -30,7 +30,7 @@
<properties>
<help>Restart DNS forwarding service</help>
</properties>
- <command>${vyos_bindir}/vyos-restart-dns-forwarding.sh</command>
+ <command>${vyos_bindir}/vyos_restart_dns_forwarding.sh</command>
</leafNode>
</children>
</node>
diff --git a/op-mode-definitions/traffic-dump.xml b/op-mode-definitions/traffic-dump.xml
index be53f866b..d8599bf93 100644
--- a/op-mode-definitions/traffic-dump.xml
+++ b/op-mode-definitions/traffic-dump.xml
@@ -12,7 +12,7 @@
<properties>
<help>Monitor traffic dump from an interface</help>
<completionHelp>
- <script>${vyos_bindir}/vyos-list-dumpable-interfaces.py</script>
+ <script>${vyos_bindir}/vyos_list_dumpable_interfaces.py</script>
</completionHelp>
</properties>
<children>
diff --git a/op-mode-definitions/version.xml b/op-mode-definitions/version.xml
index a03b41dcb..b77d52f9e 100644
--- a/op-mode-definitions/version.xml
+++ b/op-mode-definitions/version.xml
@@ -6,19 +6,19 @@
<properties>
<help>Show system version information</help>
</properties>
- <command>${vyos_bindir}/vyos-show-version.py</command>
+ <command>${vyos_bindir}/vyos_show_version.py</command>
<children>
<leafNode name="funny">
<properties>
<help>Show system version and some fun stuff</help>
</properties>
- <command>${vyos_bindir}/vyos-show-version.py --funny</command>
+ <command>${vyos_bindir}/vyos_show_version.py --funny</command>
</leafNode>
<leafNode name="all">
<properties>
<help>Show system version and versions of all packages</help>
</properties>
- <command>${vyos_bindir}/vyos-show-version.py --all</command>
+ <command>${vyos_bindir}/vyos_show_version.py --all</command>
</leafNode>
</children>
</node>
diff --git a/sonar-project.properties b/sonar-project.properties
index 7eef2d976..476285275 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -3,7 +3,7 @@ sonar.projectName=vyos-1x
sonar.projectVersion=1.2.0
sonar.organization=vyos
-sonar.sources=src/conf-mode,src/op-mode
+sonar.sources=src/conf_mode,src/op_mode
sonar.language=py
sonar.sourceEncoding=UTF-8
diff --git a/src/conf-mode/vyos-config-bcast-relay.py b/src/conf_mode/vyos_config_bcast_relay.py
index 785690d9c..785690d9c 100755
--- a/src/conf-mode/vyos-config-bcast-relay.py
+++ b/src/conf_mode/vyos_config_bcast_relay.py
diff --git a/src/conf-mode/vyos-config-dns-forwarding.py b/src/conf_mode/vyos_config_dns_forwarding.py
index be48cde60..be48cde60 100755
--- a/src/conf-mode/vyos-config-dns-forwarding.py
+++ b/src/conf_mode/vyos_config_dns_forwarding.py
diff --git a/src/conf-mode/vyos-config-host-name.py b/src/conf_mode/vyos_config_host_name.py
index 2a245b211..2a245b211 100755
--- a/src/conf-mode/vyos-config-host-name.py
+++ b/src/conf_mode/vyos_config_host_name.py
diff --git a/src/conf-mode/vyos-config-lldp.py b/src/conf_mode/vyos_config_lldp.py
index ba7e9cb13..ba7e9cb13 100644
--- a/src/conf-mode/vyos-config-lldp.py
+++ b/src/conf_mode/vyos_config_lldp.py
diff --git a/src/conf-mode/vyos-config-mdns-repeater.py b/src/conf_mode/vyos_config_mdns_repeater.py
index e648fd64f..e648fd64f 100755
--- a/src/conf-mode/vyos-config-mdns-repeater.py
+++ b/src/conf_mode/vyos_config_mdns_repeater.py
diff --git a/src/conf-mode/vyos-config-ntp.py b/src/conf_mode/vyos_config_ntp.py
index 8be12e44e..8be12e44e 100755
--- a/src/conf-mode/vyos-config-ntp.py
+++ b/src/conf_mode/vyos_config_ntp.py
diff --git a/src/conf-mode/vyos-config-ssh.py b/src/conf_mode/vyos_config_ssh.py
index a4857bba9..a4857bba9 100755
--- a/src/conf-mode/vyos-config-ssh.py
+++ b/src/conf_mode/vyos_config_ssh.py
diff --git a/src/conf-mode/vyos-update-crontab.py b/src/conf_mode/vyos_update_crontab.py
index c19b88007..c19b88007 100755
--- a/src/conf-mode/vyos-update-crontab.py
+++ b/src/conf_mode/vyos_update_crontab.py
diff --git a/src/op-mode/vyos-dns-forwarding-statistics.py b/src/op_mode/vyos_dns_forwarding_statistics.py
index 3d1e30aee..3d1e30aee 100755
--- a/src/op-mode/vyos-dns-forwarding-statistics.py
+++ b/src/op_mode/vyos_dns_forwarding_statistics.py
diff --git a/src/op-mode/vyos-list-dumpable-interfaces.py b/src/op_mode/vyos_list_dumpable_interfaces.py
index 53ee89633..53ee89633 100755
--- a/src/op-mode/vyos-list-dumpable-interfaces.py
+++ b/src/op_mode/vyos_list_dumpable_interfaces.py
diff --git a/src/op-mode/vyos-list-interfaces.py b/src/op_mode/vyos_list_interfaces.py
index 59c9dffad..59c9dffad 100755
--- a/src/op-mode/vyos-list-interfaces.py
+++ b/src/op_mode/vyos_list_interfaces.py
diff --git a/src/op-mode/vyos-restart-dns-forwarding.sh b/src/op_mode/vyos_restart_dns_forwarding.sh
index 12106fcc1..12106fcc1 100755
--- a/src/op-mode/vyos-restart-dns-forwarding.sh
+++ b/src/op_mode/vyos_restart_dns_forwarding.sh
diff --git a/src/op-mode/vyos-show-version.py b/src/op_mode/vyos_show_version.py
index ce3b3b54f..ce3b3b54f 100755
--- a/src/op-mode/vyos-show-version.py
+++ b/src/op_mode/vyos_show_version.py
diff --git a/src/tests/test_vyos_update_crontab.py b/src/tests/test_vyos_update_crontab.py
index efeadf2f5..180871300 100644
--- a/src/tests/test_vyos_update_crontab.py
+++ b/src/tests/test_vyos_update_crontab.py
@@ -17,17 +17,16 @@
#
import os
-import sys
import tempfile
import unittest
from vyos import ConfigError
-import helper
-
-file_path = 'src/conf-mode/vyos-update-crontab.py'
-module_name = 'vyos_update_crontab'
-helper.prepare_module(file_path, module_name)
-import vyos_update_crontab
+try:
+ from src.conf_mode import vyos_update_crontab
+except ModuleNotFoundError: # for unittest.main()
+ import sys
+ sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
+ from src.conf_mode import vyos_update_crontab
class TestUpdateCrontab(unittest.TestCase):