flatcar / Flatcar

Flatcar project repository for issue tracking, project documentation, etc.
https://www.flatcar.org/
Apache License 2.0
725 stars 31 forks source link

[RFE] make CI tests of update-ssh-keys work again #1081

Closed dongsupark closed 11 months ago

dongsupark commented 1 year ago

Current situation

CI tests of update-ssh-keys do not work at all, due to a missing python2 binary in the default distros in these days. The python tests were written in 2017, and since then they have been very little touched. If we simply replace python2 with python3, then it fails like:

ERROR: test_add_bad (__main__.UpdateSshKeysTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dpark/Dev/kinvolk/update-ssh-keys/tests/test_update_ssh_keys.py", line 66, in setUp
    for name, text in test_keys.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'

Implementation options

The simplest way to fix this issue to migrate the code to python3. That should be straightforwards.

Another approach would be to simply rewrite every test in Rust, just like the main code of update-ssh-keys. That makes more sense in terms of maintenance, as the repo is currently a strange mix of Rust and Python.

dongsupark commented 1 year ago

Recently discussed with @t-lo , and kind of agreed that it would be better to simply rewrite every test in Rust.

dongsupark commented 1 year ago

PR https://github.com/flatcar/update-ssh-keys/pull/9