-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtodo.txt
184 lines (162 loc) · 6.27 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
To Do file for labcontrol:
(See NOTES file for how to restart work)
= to do =
- lc <board> console
- need interactive web session for shell
- lc <board> login (or ssh)
- integration with Fuego core
- web-based shell for web-interface
- for DUT serial console
- for ssh from host to DUT
- web-based webcamera view
- allow users to connect resources to boards
- allow users to disconnect resources from boards
- allow users register boards (put-board?)
- allow users register resources (put-resource?)
- allow users to update board info (lc board set <name> <value>)
- allow users to update resource info (lc resource set <name> <value>)
- support resource reservations
== client (lc):
- "lc bbb get-resource serial" returns
Error: no resource type 'serial' associated with board 'bbb'
- this is not very helpful.
- 'lc bbb get-resource serial uart1' works
- error message should be 'needs feature name' or something like that
== server (lcserver.py):
- switch lcserver.py to eliminate old request API (non-json)
- do_put_object
- implement 'farm-status' screen to show overview of farm
- start with same data as 'farm-status' program
- with color coded status elements
- uptime for each board
- recent/running tests?? (don't tie labcontrol to Jenkins or Fuego)
- separate web and raw objects pages
- top level view is for "web ui" views
do_show
do_raw
do_api
- raw view is json file object views (mostly for debugging)
Things that work:
+ lc config
+ lc config <name>
+ lc list boards
+ lc list devices (same as lc list boards)
+ lc mydevices
+ lc list resources
+ lc <board> power status
+ lc <board> power on
+ lc <board> power off
+ lc <board> power reboot
+ lc <board> status
+ lc <board> allocate
+ lc <board> reserve
+ lc <board> release
+ lc <board> release -f
+ lc <board> get-resource <type>
+ lc <resource> power-measurement start
+ lc <resource> power-measurement stop <token>
+ lc <resource> power-measurement get-data <token>
+ lc <resource> power-measurement delete <token>
+ lc <resource> serial start
+ lc <resource> serial stop <token>
+ lc <resource> serial get_data <token>
+ lc <resource> serial delete <token>
+ echo json | lc <resource> set_config
+ echo data | lc <resource> serial put-data
+ lc <resource> camera capture [-o <filename>] [-v]
+ lc <resource> camera start
+ lc <resource> camera get-ref [-o <filename>] [-v]
+ lc <resource> camera delete
+ authentication token api
(DOES wget still work, now that we require an authentication token?)
+ wget -q -O- http://localhost:8000/api/v0.2/devices - using path api
+ wget .../api/v0.2/devices/bbb
+ wget .../api/v0.2/devices/bbb/power
+ wget .../api/v0.2/devices/bbb/power/status
+ wget .../api/v0.2/devices/bbb/power/on
+ wget .../api/v0.2/devices/bbb/power/off
+ wget .../api/v0.2/devices/bbb/power/reboot
+ wget .../api/v0.2/devices/mine
+ wget .../api/v0.2/devices/bbb/status
+ wget .../api/v0.2/devices/bbb/get_resource/power_measurement
+ wget .../api/v0.2/resources/
+ wget .../api/v0.2/resources/sdb-042
+ wget .../api/v0.2/resources/sdb-042/power_measurement/start
+ wget .../api/v0.2/resources/sdb-042/power_measurement/stop/1234
+ wget .../api/v0.2/resources/sdb-042/power_measurement/get_data/1234
+ wget .../api/v0.2/resources/sdb-042/power_measurement/delete/1234
+ wget .../api/v0.2/resources/serial-AQ/serial/start
+ wget .../api/v0.2/resources/serial-AQ/serial/stop/1234
+ wget .../api/v0.2/resources/serial-AQ/serial/get_data/1234
+ wget .../api/v0.2/resources/serial-AQ/serial/delete/1234
+ wget .../api/v0.2/resources/serial-AQ/serial/set-config
+ wget .../api/v0.2/resources/serial-AQ/serial/put-data
+ wget .../api/v0.2/resources/logitech1/camera/capture
+ wget .../api/v0.2/resources/logitech1/camera/start
+ wget .../api/v0.2/resources/logitech1/camera/stop/1234
+ wget .../api/v0.2/resources/logitech1/camera/get_ref/1234
+ wget .../api/v0.2/resources/logitech1/camera/delete/1234
= high level to dos =
- define schema for commands
- see https://fuegotest.org/wiki/LabControl_project
- define lab objects/resources
+ define boards statically
+ power controller
- bus controller
- power monitor
- serial connection
- network connection
- console
- define object attributes
- boards: name, lab, description, power-controller
- define resource verbs
- turn on/turn off
- connect
- configure
- start/stop
- define labcontrol operations
- query objects/resources
- create better web UI
- list of boards
- list of my boards
- board page:
- window for interactive console or terminal
- power status that updates autmoatically
- window for video from with board
- window for video of camera pointed at board
- list of power operations
- list of connected resources
Postponed for now:
- add security
- require authentication itself to add, update or remove requests
- require authentication to add tests or binary packages
- eliminate pages directory
- don't create tbwiki file for request in do_put_request
= security notes =
- use otp file (lab-<labname>.otp) to authenticate operations
- use for only certain operations:
- submission of requests, tests, binary-packages
- change of state for requests
(others operations don't need security, unless server is private)
- is this correct?
- algorithm to use the file is:
- on client side:
- select offset
- generate random offset (multiple of 32)
- seek to that offset
- read file (32 bytes), is value is zero, start over
- if start over too many times, search linearly for next
non-zero address, starting from last seek position
- zero out the bytes at the offset
- sync file
- send (labname, offset and value) with operation
- on server side:
- select file using labname
- seek to offset read value
- keep a log of operations, per lab: IP, offset, time
- prevent DOS attack by limiting operations to once per second
- zero out bytes at the offset
- compare sent and read values
- if no match, reject request
- if match, accept request
- create tool to show percent used of otp file