Skip to content

Commit

Permalink
Merge dev into main (Add license header) (#62)
Browse files Browse the repository at this point in the history
Add license header
  • Loading branch information
jboddey authored Jul 3, 2023
1 parent 54b4088 commit 62c8b18
Show file tree
Hide file tree
Showing 48 changed files with 656 additions and 12 deletions.
14 changes: 14 additions & 0 deletions cmd/install
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

python3 -m venv venv

source venv/bin/activate
Expand Down
14 changes: 14 additions & 0 deletions cmd/start
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if [[ "$EUID" -ne 0 ]]; then
echo "Must run as root. Use sudo cmd/start"
exit 1
Expand Down
5 changes: 1 addition & 4 deletions framework/python/src/test_orc/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ def run_test_modules(self, device):
self._run_test_module(module, device)
LOGGER.info("All tests complete")

# Wait for all containers to stop (this should actually check in future)
time.sleep(5)

self._generate_results(device)
self._test_in_progress = False

Expand All @@ -90,7 +87,7 @@ def _generate_results(self, device):
results["device"] = {}
if device.manufacturer is not None:
results["device"]["manufacturer"] = device.manufacturer
if device.manufacturer is not None:
if device.model is not None:
results["device"]["model"] = device.model
results["device"]["mac_addr"] = device.mac_addr
for module in self._test_modules:
Expand Down
14 changes: 14 additions & 0 deletions modules/devices/faux-dev/bin/get_default_gateway
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

route | grep default | awk '{print $2}'
14 changes: 14 additions & 0 deletions modules/devices/faux-dev/bin/start_dhcp_client
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Fetch the interface
INTF=$1

Expand Down
14 changes: 14 additions & 0 deletions modules/devices/faux-dev/bin/start_network_service
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Directory where all binaries will be loaded
BIN_DIR="/testrun/bin"

Expand Down
14 changes: 14 additions & 0 deletions modules/devices/faux-dev/faux-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Image name: test-run/faux-dev
FROM test-run/base:latest

Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Image name: test-run/base
FROM ubuntu:jammy

Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/bin/capture
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Fetch module name
MODULE_NAME=$1

Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/bin/setup_binaries
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Directory where all binaries will be loaded
BIN_DIR=$1

Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/bin/start_grpc
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash -e

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

GRPC_DIR="/testrun/python/src/grpc"
GRPC_PROTO_DIR="proto"
GRPC_PROTO_FILE="grpc.proto"
Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/bin/start_module
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Directory where all binaries will be loaded
BIN_DIR="/testrun/bin"

Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/bin/start_network_service
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Place holder function for testing and validation
# Each network module should include a start_networkig_service
# file that overwrites this one to boot all of the its specific
Expand Down
14 changes: 14 additions & 0 deletions modules/network/base/bin/wait_for_interface
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default interface should be veth0 for all containers
DEFAULT_IFACE=veth0

Expand Down
14 changes: 14 additions & 0 deletions modules/network/dhcp-1/bin/start_network_service
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

CONFIG_FILE=/etc/dhcp/dhcpd.conf
DHCP_PID_FILE=/var/run/dhcpd.pid
DHCP_LOG_FILE=/runtime/network/dhcp1-dhcpd.log
Expand Down
14 changes: 14 additions & 0 deletions modules/network/dhcp-1/dhcp-1.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Image name: test-run/dhcp-primary
FROM test-run/base:latest

Expand Down
14 changes: 14 additions & 0 deletions modules/network/dhcp-2/bin/start_network_service
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

CONFIG_FILE=/etc/dhcp/dhcpd.conf
DHCP_PID_FILE=/var/run/dhcpd.pid
DHCP_LOG_FILE=/runtime/network/dhcp2-dhcpd.log
Expand Down
14 changes: 14 additions & 0 deletions modules/network/dhcp-2/dhcp-2.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Image name: test-run/dhcp-primary
FROM test-run/base:latest

Expand Down
14 changes: 14 additions & 0 deletions modules/network/dns/bin/start_network_service
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/bin/bash

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

CONFIG_FILE=/etc/dnsmasq.conf
PID_FILE=/var/run/dnsmasq.pid
LOG_FILE=/runtime/network/dns.log
Expand Down
14 changes: 14 additions & 0 deletions modules/network/dns/dns.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Image name: test-run/dns
FROM test-run/base:latest

Expand Down
Loading

0 comments on commit 62c8b18

Please sign in to comment.