NASA-AMMOS / AIT-Core

MIT License
45 stars 27 forks source link

`packet_handler` and `ait_tlm_simulate` Test #238

Closed Futabay closed 4 years ago

Futabay commented 4 years ago
  1. Precondition:

    1. AIT is installed with virtual environment
    2. Virtual environment is started by typing workon ait on your working terminals
  2. Set config.yaml as follows:

    inbound-streams:
            - stream:
                name: log_stream
                input: 
                    - 2514
    
            - stream:
                name: telem_stream
                input: 
                    - 3076
                handlers:
                    - name: ait.core.server.handlers.PacketHandler
                      packet: 1553_HS_Packet
  3. Start ait-server

    (ait) $ ait-server
    2020-02-08T11:22:36.125 | WARNING  | Config parameter command.history.filename specifies nonexistent path </some/path/to>/cmdhist.pcap
    2020-02-08T11:22:36.127 | WARNING  | Config parameter dsn.cfdp.mib.path specifies nonexistent path </some/path/to>/AIT-Core/config/mib
    2020-02-08T11:22:36.128 | WARNING  | Config parameter dsn.cfdp.datasink.outgoing.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/outgoing
    2020-02-08T11:22:36.129 | WARNING  | Config parameter dsn.cfdp.datasink.incoming.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/incoming
    2020-02-08T11:22:36.130 | WARNING  | Config parameter dsn.cfdp.datasink.tempfiles.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/tempfiles
    2020-02-08T11:22:36.131 | WARNING  | Config parameter dsn.cfdp.datasink.pdusink.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/pdusink
    2020-02-08T11:22:36.132 | WARNING  | Config parameter data.1553.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/downlink/1553
    2020-02-08T11:22:36.134 | WARNING  | Config parameter data.bad.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/downlink/bad
    2020-02-08T11:22:36.135 | WARNING  | Config parameter data.lehx.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/downlink/lehx
    2020-02-08T11:22:36.136 | WARNING  | Config parameter data.planning.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/planning
    2020-02-08T11:22:36.137 | WARNING  | Config parameter data.sdos.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/sdos
    2020-02-08T11:22:36.139 | WARNING  | Config parameter data.uplink.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/uplink
    2020-02-08T11:22:36.140 | WARNING  | Config parameter data.ats.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/ats
    2020-02-08T11:22:36.883 | WARNING  | No handlers specified for stream log_stream
    2020-02-08T11:22:36.884 | INFO     | Added inbound stream <PortInputStream address=:2514>
    2020-02-08T11:22:37.115 | INFO     | Created handler PacketHandler for stream telem_stream
    2020-02-08T11:22:37.117 | INFO     | Added inbound stream <PortInputStream address=:3076>
    2020-02-08T11:22:37.118 | WARNING  | No handlers specified for stream command_stream
    2020-02-08T11:22:37.120 | INFO     | Added outbound stream <PortOutputStream name=command_stream>
    2020-02-08T11:22:37.233 | WARNING  | [GUI Playback Configuration]Unable to locate DataArchive plugin configuration for historical data queries. Historical telemetry playback will be disabled in monitoring UI and server endpoints.
    2020-02-08T11:22:37.243 | INFO     | Running AIT GUI v1.4.0
    2020-02-08T11:22:37.246 | INFO     | Added plugin <Plugin name=AITGUIPlugin>
    2020-02-08T11:22:37.247 | INFO     | Starting <Broker at 0x10c71fef0: _run> greenlet...
    2020-02-08T11:22:37.248 | INFO     | Starting <Plugin name=AITGUIPlugin> greenlet...
    2020-02-08T11:22:37.250 | INFO     | Starting <PortOutputStream name=command_stream> greenlet...
    2020-02-08T11:22:37.251 | INFO     | Starting <PortInputStream address=:2514> greenlet...
    2020-02-08T11:22:37.253 | INFO     | Starting <PortInputStream address=:3076> greenlet...
    2020-02-08T11:22:37.288 | INFO     | Subscribing <Plugin name=AITGUIPlugin> to topic log_stream
    2020-02-08T11:22:37.293 | INFO     | Subscribing <Plugin name=AITGUIPlugin> to topic telem_stream
    2020-02-08T11:22:37.294 | INFO     | Subscribing <PortOutputStream name=command_stream> to topic AITGUIPlugin
    2020-02-08T11:22:37.295 | INFO     | Starting broker...
  4. On a different terminal, run ait-tlm-simulate

    (ait) $ ait-tlm-simulate
    2020-02-08T11:30:32.758 | WARNING  | Config parameter command.history.filename specifies nonexistent path </some/path/to>/cmdhist.pcap
    2020-02-08T11:30:32.767 | WARNING  | Config parameter dsn.cfdp.mib.path specifies nonexistent path </some/path/to>/AIT-Core/config/mib
    2020-02-08T11:30:32.769 | WARNING  | Config parameter dsn.cfdp.datasink.outgoing.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/outgoing
    2020-02-08T11:30:32.771 | WARNING  | Config parameter dsn.cfdp.datasink.incoming.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/incoming
    2020-02-08T11:30:32.772 | WARNING  | Config parameter dsn.cfdp.datasink.tempfiles.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/tempfiles
    2020-02-08T11:30:32.773 | WARNING  | Config parameter dsn.cfdp.datasink.pdusink.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/pdusink
    2020-02-08T11:30:32.775 | WARNING  | Config parameter data.1553.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/downlink/1553
    2020-02-08T11:30:32.776 | WARNING  | Config parameter data.bad.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/downlink/bad
    2020-02-08T11:30:32.777 | WARNING  | Config parameter data.lehx.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/downlink/lehx
    2020-02-08T11:30:32.780 | WARNING  | Config parameter data.planning.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/planning
    2020-02-08T11:30:32.781 | WARNING  | Config parameter data.sdos.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/sdos
    2020-02-08T11:30:32.782 | WARNING  | Config parameter data.uplink.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/uplink
    2020-02-08T11:30:32.784 | WARNING  | Config parameter data.ats.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-039/ats
    2020-02-08T11:30:33.167 | PROGRAM  | /Users/kkallas/.virtualenvs/ait/bin/ait-tlm-simulate
    2020-02-08T11:30:33.171 | INFO     | Sent telemetry (10 bytes) to 127.0.0.1:3076
    2020-02-08T11:30:34.175 | INFO     | Sent telemetry (10 bytes) to 127.0.0.1:3076
    2020-02-08T11:30:35.178 | INFO     | Sent telemetry (10 bytes) to 127.0.0.1:3076
    2020-02-08T11:30:36.182 | INFO     | Sent telemetry (10 bytes) to 127.0.0.1:3076
  5. Type Ctrl+C to stop ait-tlm-simulate and ait-server

MJJoyce commented 4 years ago

I'm going to mark this as good enough since we use the PacketHandler in line with lots of data flow testing and are confident it works. :+1:

MJJoyce commented 4 years ago

Note, I think a bit more thorough run of ait-tlm-simulate would be good in the future. I'm also opening up AIT-GUI#161 to replace the hard coded functionality there with ait-tlm-simulate calls. I think that will adequately test as well.