1. 29 Jun, 2022 1 commit
  2. 18 Feb, 2022 3 commits
  3. 31 Jan, 2022 17 commits
    • Karel Koci's avatar
      nsfarm/board: set TFTP block and window size · fbf1d283
      Karel Koci authored
      Not every board has reasonable (huge as possible) TFTP block and window
      size set. Thus the TFTP performance is hurt. Setting it explicitly makes
      TFTP performance reasonable on all boards (cca 1.7MB/s).
    • Karel Koci's avatar
      nsfarm/cli: get rid of exit_code and replace it with check · 4a6ff430
      Karel Koci authored
      The original idea of exit_code was to allow flexibility of handling exit
      code. The true is that most of our uses were to set it to None to
      disable the default handler to get exit code. This use case now covers
      check attribute instead. Any other use can be covered by getting exit
      code from run method and doing anything with it later on.
      The check attribute was selected to be consistent with standard
    • Karel Koci's avatar
      nsfarm/board: attempt network boot again if we encounter issue · e11543f0
      Karel Koci authored
      This covers a known issue in the Turris Mox. Sometimes the U-Boot is
      unable to bring up the ethernet device. The message is "bad rx status"
      that repeats. The reboot of the board helps this implements that we
      attempt the boot again if we encounter this issue.
    • Karel Koci's avatar
      nsfarm/cli: allow to expect also other patterns except of prompt · aff4516a
      Karel Koci authored
      This allows to also match additional expressions alongside of the
      prompt. The idea is that we can use it to detect failure early and act
      on it.
    • Karel Koci's avatar
      tests/sentinel: fix occasional fail of dynfw tests · a6900ee7
      Karel Koci authored
      Sometimes the removal of IP from the set fails and that signals that for
      some reason the set was either flushed or that IP address was just
      simply removed from it. The only possible culprit is the
      sentinel-dynfw-client and thus we disable it for duration of dynfw
      firewall tests.
    • Karel Koci's avatar
      nsfarm/setup/openwrt: implement Service · e1f810e3
      Karel Koci authored
      We sometimes want to change state of some services on the router. That
      can be either to stop it temporally for test or start it. This
      implements setup for exactly that.
    • Karel Koci's avatar
      nsfarm/web/reforis/guide: set default timeout for wait to one minute · d7caa9aa
      Karel Koci authored
      The original 10 seconds were just too short time considering that
      sometimes we have to reload newtork configuration before we proceede to
      the next step in the guide. The tests that do that such as interfaces
      were failing because of that. The one minit is reasonable time we can
      give it before we consider it a failed state.
    • Karel Koci's avatar
      nsfarm/toolbox/alpine: fix network_connect invalid detection · d03067ea
      Karel Koci authored
      The nc does not return "succeeded" but rather "open" now, so relying on
      exit code is much better.
    • Karel Koci's avatar
      imgs/openwrt: update to OpenWrt 21.02 · 0263b893
      Karel Koci authored
      This fixes invalid tests for password. We can use the complete password
      and let crypt to parse it on its own without us doing it wrongly.
    • Karel Koci's avatar
      tests/sentinel: update tests · 9b51f7f7
      Karel Koci authored
      The check for output in test_attack_blocked had no effect. This changes
      that and adds assert.
      The sentinel-nikola is with Turris OS 5.3 relaced by sentinel-fwlogs.
    • Karel Koci's avatar
      tests,selftests: use yield in fixtures instead of return · d524b56d
      Karel Koci authored
      This requires some explanation specially because I was unable to locate
      the root cause of the weirdness. The initial find was in selftests. The
      selftests were passing on their own but once they were included in one
      test run with tests the test cli.test_shell.test_txt[OpenWrt] started
      failing but in setup of the fixture shell. It seemed that the new shell
      session was forked but not exactly correctly connected. The shell in the
      end was unable to read anything. At the same time there was output from
      previous pexpect instances (thanks to logging). So it seems like somehow
      the pexpect instances were messed up. When I added log message before
      return it turned out that not on every test it was called and log (where
      there should have been busybox banner) confirmed that. The "fix" by
      changing return to yield was discovered by random as I switched it
      around to add also log message for teardown. That suddenly started
      working and issue disappeared. I tested a multiple combination and I
      can't found out what triggers this behavior. I really think that this is
      a bug in Pytest. It for sure handles fixtures that are just functions
      and not generators slightly differently. Just to be sure I switched all
      returns in fixtures to yields.
    • Karel Koci's avatar
    • Karel Koci's avatar
      nsfarm/board: fix boot of Turris OS 6.0 on Mox · 0f8dab0f
      Karel Koci authored
      There is a bug in (old) stock version of U-Boot's trusted firmware that
      causes stall. The fix is to remove phy property from dtb. We do that
      only on the old U-Boots and keep it as it is on new ones. This is
      consistent with boot script behavior.
    • Karel Koci's avatar
      tests: fix not working Internet access after WAN network tests · 87bf0421
      Karel Koci authored
      The WAN tests configure and reload network settings to test various
      Internet access methods. The issue here is simply that after that is
      done and configuration is reverted it takes some time before the
      Internet access is reestablished from DHCP. Thus this twists existing
      code to allow call to generic function for waiting for uplink in an
      appropriate moment.
    • Karel Koci's avatar
      tests/reforis/guide: fix failures of test_save_and_next tests · 9c6bb5af
      Karel Koci authored
      The next button text now contains space so xpath no longer matched. The
      new xpath does not rely on text but is too general now. Unfortunately
      there is probably no other way around this.
    • Karel Koci's avatar
      tests/reforis/guide/test_password: allow guide skip · f2d0a868
      Karel Koci authored
      The reForis now allows guide skip immediately when password is set. Thus
      the test_skip_after_password no longer fails.
    • Karel Koci's avatar
      tests/reforis: fix inaccessible router · 717ef873
      Karel Koci authored
      This changes configuration for client container from static IP to DHCP.
      The reason is because we spawn multiple clients in parallel (especially
      with selenium) and having them all on same static IP does not work. At
      the same time we want to have the primary client container on static IP
      so when we test DHCP we won't break our primary connection to the
      Thus this converts the client-dhcp to client-static and makes client a
      This also cleanups the client-static (previously client-dhcp) bootstrap
      script. There is no need to install software that is already installed
      in client.
  4. 24 Jan, 2022 11 commits
  5. 18 Jan, 2022 7 commits
    • Karel Koci's avatar
      nsfarm/cli: allow passing of pathlib.PurePosixPath to read and write · 41b08103
      Karel Koci authored
      This allows not only strings but also pathlib.PurePosixPath as that is a
      common format we are using to work with paths.
      This is rather about typing. The code itself works regardless thanks to
      pathlib.PurePosixPath implementation.
    • Karel Koci's avatar
    • Karel Koci's avatar
      tests/contest: use SSH keys instead of password to access board · ef7fe4a7
      Karel Koci authored
      This still sets the root password but that is only to unlock the
      account. The key is used instead to authenticate and access the board.
    • Karel Koci's avatar
      tests/conftest: allow a unique shell for every test · 6c37b07a
      Karel Koci authored
      This should increase tests resilience as we can now spawn new shell
      instance for every test and thus taint of shell from one test can't
      influence others.
      This of course needs changes in existing tests and that is not part of
      this code. The update of existing code and removal of client_board
      fixture in favor of board_access should be done in the future. For now
      client_board is documented as obsolete and not suggested for the new
      The disadvantage of this change is that every fixture that wants to do a
      simple call (such as uci or cat) has to create its own connection and
      that can get spammy pretty fast. The solution for this is the new
      fixture fixture_board_access. This provides one shell instance. In
      reality it provides shell instance that can reconnect. This is due to
      issues when client container would change its IP address (for example
      when we change LAN addressing).
    • Karel Koci's avatar
      nsfarm/setup/utils: add directory and file deployment setups · f74e888e
      Karel Koci authored
      These setups are handy in general. They created files and diretories
      that are automatically removed on revert.
    • Karel Koci's avatar
      nsfarm/setup/board: add root password, package install setups · d624f483
      Karel Koci authored
      The RootPassword is used in conftest.py and might be usable in other
      places as well. Part of this are tests on OpenWrt container to make sure
      that setup works as expected and also setups for installing packages in
      both OpenWrt and Alpine.
    • Karel Koci's avatar
      nsfarm/setup: implement updater setup · 601ed7a8
      Karel Koci authored
      This should allow us to configure and call updater in reasonably common
      way. The setup currently covers features we already were using and also
      one generic Updater centric setup that is not required at the moment but
      is going to be for future testing of updater.
  6. 06 Jan, 2022 1 commit
    • Karel Koci's avatar
      selftests/cli: use lorem-text instead of static lorem ipsum · 4051e8c9
      Karel Koci authored
      This replaces static strings with generated ones from lorem-text
      To make tests reproducible we have to se seed for random. This is pretty
      common so this adds context function for it to toolbox.
      Toolbox was labeled as common tasks run on router. Now this changes it
      to just generic common toolbox and splits it to three submodules. There
      is module for Alpine Linux as well as for OpenWrt. Then there is one
      additional module for utilities needed in tests implementation.