Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed docs/test/new_module.md
Empty file.
Empty file removed docs/test/new_test.md
Empty file.
20 changes: 10 additions & 10 deletions framework/python/src/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
DEVICE_TEST_MODULES_KEY = "test_modules"

class Api:
"""Provide REST endpoints to manage Test Run"""
"""Provide REST endpoints to manage Testrun"""

def __init__(self, test_run):

Expand Down Expand Up @@ -68,7 +68,7 @@ def __init__(self, test_run):
)

self._api_thread = threading.Thread(target=self._start,
name="Test Run API",
name="Testrun API",
daemon=True)

def start(self):
Expand Down Expand Up @@ -128,14 +128,14 @@ async def start_test_run(self, request: Request, response: Response):

device = self._session.get_device(body_json["device"]["mac_addr"])

# Check Test Run is not already running
# Check Testrun is not already running
if self._test_run.get_session().get_status() in [
"In Progress",
"Waiting for Device",
]:
LOGGER.debug("Testrun is already running. Cannot start another instance")
response.status_code = status.HTTP_409_CONFLICT
return self._generate_msg(False, "Test Run is already running")
return self._generate_msg(False, "Testrun is already running")

# Check if requested device is known in the device repository
if device is None:
Expand All @@ -145,17 +145,17 @@ async def start_test_run(self, request: Request, response: Response):

device.firmware = body_json["device"]["firmware"]

# Check Test Run is able to start
# Check Testrun is able to start
if self._test_run.get_net_orc().check_config() is False:
response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
return self._generate_msg(False,"Configured interfaces are not ready for use. Ensure required interfaces are connected.")

self._test_run.get_session().reset()
self._test_run.get_session().set_target_device(device)
LOGGER.info(f"Starting Test Run with device target {device.manufacturer} {device.model} with MAC address {device.mac_addr}")
LOGGER.info(f"Starting Testrun with device target {device.manufacturer} {device.model} with MAC address {device.mac_addr}")

thread = threading.Thread(target=self._start_test_run,
name="Test Run")
name="Testrun")
thread.start()
return self._test_run.get_session().to_json()

Expand All @@ -169,9 +169,9 @@ def _start_test_run(self):
self._test_run.start()

async def stop_test_run(self):
LOGGER.debug("Received stop command. Stopping Test Run")
LOGGER.debug("Received stop command. Stopping Testrun")
self._test_run.stop()
return self._generate_msg(True, "Test Run stopped")
return self._generate_msg(True, "Testrun stopped")

async def get_status(self):
return self._test_run.get_session().to_json()
Expand All @@ -197,7 +197,7 @@ async def save_device(self, request: Request, response: Response):

# Create new device
device = Device()
device.mac_addr = device_json.get(DEVICE_MAC_ADDR_KEY)
device.mac_addr = device_json.get(DEVICE_MAC_ADDR_KEY).lower()
device.manufacturer = device_json.get(DEVICE_MANUFACTURER_KEY)
device.model = device_json.get(DEVICE_MODEL_KEY)
device.device_folder = device.manufacturer + " " + device.model
Expand Down
27 changes: 0 additions & 27 deletions modules/ui/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions modules/ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,5 @@
}
}
}
},
"cli": {
"analytics": false
}
}
13 changes: 0 additions & 13 deletions modules/ui/nginx.conf

This file was deleted.

19 changes: 18 additions & 1 deletion modules/ui/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/**
* 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.
*/
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {allowToRunTestGuard} from './guards/allow-to-run-test.guard';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';

const routes: Routes = [
{
Expand All @@ -26,7 +42,8 @@ const routes: Routes = [

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
exports: [RouterModule],
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}]
})
export class AppRoutingModule {
}
15 changes: 15 additions & 0 deletions modules/ui/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<!--
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.
-->
<mat-drawer-container hasBackdrop="false" class="app-container">
<mat-drawer mode="side" role="navigation" opened cdkFocusInitial>
<div class="app-sidebar">
Expand Down
15 changes: 15 additions & 0 deletions modules/ui/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
@use '@angular/material' as mat;
@import "../theming/colors";

Expand Down
17 changes: 16 additions & 1 deletion modules/ui/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
/**
* 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.
*/
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
import {Router} from '@angular/router';
import {RouterTestingModule} from '@angular/router/testing';
import {AppComponent} from './app.component';
import {TestRunService} from './test-run.service';
import SpyObj = jasmine.SpyObj;
import {BehaviorSubject} from 'rxjs/internal/BehaviorSubject';
import {Device} from './model/device';
import {device} from './mocks/device.mock';
Expand All @@ -15,6 +29,7 @@ import {MatToolbarModule} from '@angular/material/toolbar';
import {MatSidenavModule} from '@angular/material/sidenav';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {AppRoutingModule} from './app-routing.module';
import SpyObj = jasmine.SpyObj;

describe('AppComponent', () => {
let component: AppComponent;
Expand Down
15 changes: 15 additions & 0 deletions modules/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
import {Component, OnInit, ViewChild} from '@angular/core';
import {MatIconRegistry} from '@angular/material/icon';
import {DomSanitizer} from '@angular/platform-browser';
Expand Down
15 changes: 15 additions & 0 deletions modules/ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
import {HttpClientModule} from '@angular/common/http';
import {NgModule} from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<!--
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.
-->
<button (click)="itemClick()" [attr.aria-label]="'Edit device {{device.model}}'"
class="device-item" type="button">
<div [attr.aria-label]="device.model" class="item-name">{{device.model}}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
@import "../../../theming/colors";
@import "../../../theming/variables";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {Device} from '../../model/device';

Expand Down
15 changes: 15 additions & 0 deletions modules/ui/src/app/components/device-item/device-item.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {Device} from '../../model/device';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<!--
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.
-->
<form [class.disabled]="disabled" [formGroup]="deviceForm">
<section class="device-form-test-modules" formArrayName="test_modules">
<p class="device-tests-title">Device options</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* 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.
*/
@import "../../../theming/colors";

:host {
Expand Down
Loading