src/network-radvd-config \
src/header-config \
src/header-port \
- src/header-zone \
- src/ppp/dialer \
- src/ppp/pppoe-server
+ src/header-zone
dist_network_SCRIPTS = \
- src/dhclient-helper
+ src/dhclient-helper \
+ src/ppp/dialer \
+ src/ppp/pppoe-server
dist_helpers_SCRIPTS = \
src/helpers/dhcpd-config-helper \
NITSI_TESTS = \
test/nitsi/test/make-check \
test/nitsi/test/phase1 \
+ test/nitsi/test/pppoe \
test/nitsi/test/raw-device-get-by-mac \
test/nitsi/test/zone-new-bridge \
test/nitsi/test/zone-port-attach-bridge \
NITSI_ENVIRONMENT =
.PHONY: $(NITSI_TESTS)
-$(NITSI_TESTS): % : %/recipe %/settings test/nitsi/test/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES)
- $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level debug run-test -d $@ --interactive-error-handling \
- --default-settings $(abs_builddir)/test/nitsi/test/settings
+$(NITSI_TESTS): % : dist %/recipe %/settings test/nitsi/test/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(NITSI_INCLUDE_RECIPES)
+ $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error run-test -d $@ \
+ --default-settings $(abs_builddir)/test/nitsi/test/settings --interactive-error-handling
.PHONY: nitsi
-nitsi: dist $(NITSI_TESTS)
+nitsi: $(NITSI_TESTS)
# Downloads a virtual image file and extracts it
$(VIRTUAL_ENVIRONMENT_IMAGES):
rm -f "${path}"
}
+
+zone_config_find_by_hook() {
+ local zone="${1}"
+ assert isset zone
+
+ local hook="${2}"
+ assert isset hook
+
+ local config
+ for config in $(zone_configs_list "${zone}"); do
+ local h="$(zone_config_get_hook "${zone}" "${config}")"
+
+ [[ "${hook}" = "${h}" ]] && echo "${config}"
+ done
+
+ return ${EXIT_OK}
+}
+
+zone_config_settings_read_by_hook() {
+ local zone="${1}"
+ assert isset zone
+
+ local hook="${2}"
+ assert isset hook
+
+ local config
+ for config in $(zone_config_find_by_hook "${zone}" "${hook}"); do
+ zone_config_settings_read "${zone}" "${config}"
+ done
+
+ return ${EXIT_OK}
+}
+
zone_port_settings_read() {
assert [ $# -ge 2 ]
exit ${EXIT_OK}
}
+hook_port_up() {
+ assert [ $# -eq 2 ]
+
+ local zone="${1}"
+ local port="${2}"
+
+ # Try bringing up the port if it has not been brought up before
+ if ! device_exists "${port}"; then
+ port_create "${port}"
+ fi
+
+ # Make sure that the port is up
+ port_up "${port}"
+
+ exit ${EXIT_OK}
+}
+
+hook_port_down() {
+ assert [ $# -eq 2 ]
+
+ local zone="${1}"
+ local port="${2}"
+
+ if device_exists "${port}"; then
+ port_down "${port}"
+ fi
+
+ exit ${EXIT_OK}
+}
+
hook_ppp_ipv6_up() {
local zone="${1}"
action=${2}
# Read the configuration file of this hook.
-zone_config_settings_read "${zone}" "pppoe-server"
+zone_config_settings_read_by_hook "${zone}" "pppoe-server"
assert isset SUBNET
pppd_options="${RUN_DIR}/${zone}/pppoe-server-options"
log DEBUG "pppoe-server options: ${pppoe_cmdline}"
# Now exec the actual pppoe-server binary.
- exec pppoe-server ${pppoe_cmdline}
+ exec /usr/sbin/pppoe-server ${pppoe_cmdline}
error "Could not execute pppoe-server. Exiting."
exit ${EXIT_ERROR}
--- /dev/null
+include: ../../include/setup
+
+# Get port names for Alice and Bob
+include: ../../include/alice-port-vars
+include: ../../include/bob-port-vars
+
+# Start a PPPoE server on Alice
+alice: network zone new upl0 bridge
+alice: network zone upl0 port attach ${p_net1}
+alice: network zone upl0 config new pppoe-server --subnet=192.168.123.0/24
+
+# Start a PPPoE client on Bob
+bob: network zone new upl0 pppoe --username=USER --password=PASSWORD
+bob: network zone upl0 port attach ${p_net1}
+
+# Show status
+all: network status
+
+# TODO need to check if the connection has come up
--- /dev/null
+[GENERAL]
+name = PPPoE Server/Client
+description = This test creates a PPPoE server and client and tries to connect the two of them