NASA-AMMOS / AIT-Core

MIT License
45 stars 27 forks source link

'ait-seq-send' Test #248

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
    3. .rts file needs to be available. The file was created based on https://github.com/NASA-AMMOS/AIT-Core/issues/168#issuecomment-505651260
  2. Go to a terminal, invoke ait-seq-send command

    
    (ait) $  ait-seq-send </path/to>/test.rts
    2020-02-24T21:36:07.524 | WARNING  | Config parameter command.history.filename specifies nonexistent path </some/path/to>/cmdhist.pcap
    2020-02-24T21:36:07.527 | WARNING  | Config parameter dsn.cfdp.mib.path specifies nonexistent path </some/path/to>/AIT-Core/config/mib
    2020-02-24T21:36:07.529 | WARNING  | Config parameter dsn.cfdp.datasink.outgoing.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/outgoing
    2020-02-24T21:36:07.531 | WARNING  | Config parameter dsn.cfdp.datasink.incoming.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/incoming
    2020-02-24T21:36:07.532 | WARNING  | Config parameter dsn.cfdp.datasink.tempfiles.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/tempfiles
    2020-02-24T21:36:07.534 | WARNING  | Config parameter dsn.cfdp.datasink.pdusink.path specifies nonexistent path </some/path/to>/AIT-Core/ait/dsn/cfdp/datasink/pdusink
    2020-02-24T21:36:07.536 | WARNING  | Config parameter data.1553.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/downlink/1553
    2020-02-24T21:36:07.538 | WARNING  | Config parameter data.bad.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/downlink/bad
    2020-02-24T21:36:07.540 | WARNING  | Config parameter data.lehx.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/downlink/lehx
    2020-02-24T21:36:07.541 | WARNING  | Config parameter data.planning.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/planning
    2020-02-24T21:36:07.543 | WARNING  | Config parameter data.sdos.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/sdos
    2020-02-24T21:36:07.545 | WARNING  | Config parameter data.uplink.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/uplink
    2020-02-24T21:36:07.547 | WARNING  | Config parameter data.ats.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-056/ats
    2020-02-24T21:36:08.188 | PROGRAM  | </your/path/to>/.virtualenvs/ait/bin/ait-seq-send </path/to>/test.rts
    2020-02-24T21:36:10.199 | INFO     | 2 SEND_STR_ARG 1
    Traceback (most recent call last):
    File "</your/path/to>/.virtualenvs/ait/bin/ait-seq-send", line 11, in <module>
    load_entry_point('ait-core', 'console_scripts', 'ait-seq-send')()
    File "</some/path/to>/AIT-Core/ait/core/bin/ait_seq_send.py", line 96, in main
    cmd.send(name, *args)
    File "</some/path/to>/AIT-Core/ait/core/api.py", line 141, in send
    encoded = cmdobj.encode()
    File "</some/path/to>/AIT-Core/ait/core/cmd.py", line 253, in encode
    encoded[defn.slice(offset)] = defn.encode(value)
    File "</some/path/to>/AIT-Core/ait/core/cmd.py", line 116, in encode
    return self.type.encode(value) if self.type else bytearray()
    File "</some/path/to>/AIT-Core/ait/core/dtype.py", line 243, in encode
    return bytearray(struct.pack(self.format, fvalue))
    struct.error: argument for 's' must be a bytes object
Futabay commented 4 years ago

Found Bugs: There seems to be an issue that dtype.py encoding string args. dtype.py#L242 Further investigation is required.

MJJoyce commented 4 years ago

@Futabay, can you rerun this with the merged fix from @nttoole and verify this works now?

If so we can close this out.

Futabay commented 4 years ago

Confirmed the fix

(ait) LMC-062858:AIT kkallas$ ait-seq-send test.rts
2020-04-16T16:20:27.815 | WARNING  | Config parameter dsn.cfdp.mib.path specifies nonexistent path /Users/kkallas/Documents/github/AIT/AIT-Core/config/mib
2020-04-16T16:20:27.816 | WARNING  | Config parameter dsn.cfdp.datasink.outgoing.path specifies nonexistent path /Users/kkallas/Documents/github/AIT/AIT-Core/ait/dsn/cfdp/datasink/outgoing
2020-04-16T16:20:27.818 | WARNING  | Config parameter dsn.cfdp.datasink.incoming.path specifies nonexistent path /Users/kkallas/Documents/github/AIT/AIT-Core/ait/dsn/cfdp/datasink/incoming
2020-04-16T16:20:27.819 | WARNING  | Config parameter dsn.cfdp.datasink.tempfiles.path specifies nonexistent path /Users/kkallas/Documents/github/AIT/AIT-Core/ait/dsn/cfdp/datasink/tempfiles
2020-04-16T16:20:27.821 | WARNING  | Config parameter dsn.cfdp.datasink.pdusink.path specifies nonexistent path /Users/kkallas/Documents/github/AIT/AIT-Core/ait/dsn/cfdp/datasink/pdusink
2020-04-16T16:20:27.822 | WARNING  | Config parameter data.1553.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/downlink/1553
2020-04-16T16:20:27.824 | WARNING  | Config parameter data.bad.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/downlink/bad
2020-04-16T16:20:27.826 | WARNING  | Config parameter data.lehx.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/downlink/lehx
2020-04-16T16:20:27.827 | WARNING  | Config parameter data.planning.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/planning
2020-04-16T16:20:27.828 | WARNING  | Config parameter data.sdos.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/sdos
2020-04-16T16:20:27.830 | WARNING  | Config parameter data.uplink.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/uplink
2020-04-16T16:20:27.831 | WARNING  | Config parameter data.ats.path specifies nonexistent path /gds/dev/data/LMC-062858/2020/2020-107/ats
2020-04-16T16:20:28.499 | PROGRAM  | /Users/kkallas/.virtualenvs/ait/bin/ait-seq-send test.rts
2020-04-16T16:20:30.508 | INFO     | 2 SEND_STR_ARG 1
2020-04-16T16:20:30.511 | COMMAND  | Sending to 127.0.0.1:3075: SEND_STR_ARG 1
2020-04-16T16:20:34.521 | INFO     | 4 SEND_STR_ARG argument
2020-04-16T16:20:34.525 | COMMAND  | Sending to 127.0.0.1:3075: SEND_STR_ARG argument
2020-04-16T16:20:40.528 | INFO     | 6 SEND_STR_ARG 1.1
2020-04-16T16:20:40.530 | COMMAND  | Sending to 127.0.0.1:3075: SEND_STR_ARG 1.1
2020-04-16T16:20:50.533 | INFO     | 10 SEQ_ENABLE_DISABLE 21 ENABLED
2020-04-16T16:20:50.536 | COMMAND  | Sending to 127.0.0.1:3075: SEQ_ENABLE_DISABLE 21 ENABLED
2020-04-16T16:20:50.539 | PROGRAM  | done.