Skip to content
Snippets Groups Projects
  1. Oct 13, 2021
  2. Sep 24, 2021
  3. Aug 18, 2021
  4. Aug 03, 2021
    • Karel Koci's avatar
      nsfarm/lxd: fix image hash calculation · c56829c8
      Karel Koci authored
      The issue here is that we should not use full path to file never to
      calculate hash as different location of NSFarm project result in
      different hashes and thus we do not share them at all.
      This makes one instance where we included full path just relative to
      images directory. This way the path should be contant no matter where
      the project is located.
      
      This also does small tweak in form of removal of unnecessary
      comprehension error. We can convert directly to list without creating
      generator.
      Verified
      c56829c8
    • Karel Koci's avatar
      tests: use container.shell for wait scripts invocation · 8197146c
      Karel Koci authored
      The previous commit added shell property exactly for this. This now
      tweaks code to use it.
      Verified
      8197146c
    • Karel Koci's avatar
      nsfarm/web: add Selenium container class · 335126c4
      Karel Koci authored
      This implements dedicated Selenium container class as an extension to
      LXD Container. This class provides easy access to Selenium drivers for
      selected browser.
      The special hack in Selenium extended Container class is that it is able
      to run vncviewer on its start. This is controlled by class variable that
      can be set for nsfasrm run. This way developer can select to see what is
      happening on virtual desktop browsers are spawned to.
      
      With all this there is also need to store some screenshots as part of
      failed or even standard execution of tests. The screenshot fixture was
      created for this purpose. It hides some ugliness of screenshot saving.
      
      Minor but notable tweak here is addition of shell property to
      container. The idea is to prevent spawning of multiple one-time use
      shells we do for wait commands. The regular usage for testing is
      discouraged.
      Verified
      335126c4
    • Karel Koci's avatar
    • Karel Koci's avatar
      imgs/selenium: add new image · 32e311dd
      Karel Koci authored
      This is image that can be used to test web interface.
      
      It is based on client container but we do not want to put this as part
      of it. It generates pretty big image and in most tests it is not
      necessary to start web drivers.
      
      The container itself provides driver for Chrome (Chromium) and Firefox
      browsers.
      There is also driver for WebKit but it does not work, it crashes right
      now so it is there just for the future once something is fixed in
      upstream or we found out what we are doing wrong.
      Verified
      32e311dd
    • Karel Koci's avatar
      nsfarm/lxd: add ability to proxy TCP and UDP ports · bc286a97
      Karel Koci authored
      This allows access of TCP and UDP services trough container. This can be
      used not only to access services running locally in container but also
      any service accessible from container network.
      
      The simple use case of this is access of web interfaces of router.
      Verified
      bc286a97
    • Karel Koci's avatar
      imgs/base-alpine: fix mount of /dev/shm · a77aaddd
      Karel Koci authored
      The Alpine Linux creates /dev/shm using init script devfs but that is
      not run in container. It won't even run correctly in container. That
      makes /dev/shm unavailable but we need it in some cases and thus this is
      hacky script that adds just very small init script that creates it.
      Verified
      a77aaddd
  5. Jun 22, 2021
    • Karel Koci's avatar
      tests/test_bootup: do not match exactly · 7a747bbf
      Karel Koci authored
      The issue here is that some applications such as sshd are modifying its
      own arguments to store readable info in there. This breaks check for
      processes but they keep its name intact and so we can match that.
      
      The -x is replaced with -a to show process info in logs so we can
      identify if we match something that is not suppose to be matched.
      Verified
      7a747bbf
    • Karel Koci's avatar
      nsfarm/board: wait for boot longer · 55bcefc4
      Karel Koci authored
      This is to support HBD that right now boots way longer.
      Waiting four minutes for boot is very long time but for testing it is
      reasonable to margin for boot.
      Verified
      55bcefc4
    • Jan Miksik's avatar
      tests: Added basic throughput tests · c385d63a
      Jan Miksik authored and Karel Koci's avatar Karel Koci committed
      Added basic throughput tests for basic testing.
      Test is run for 60 seconds and checks if the speed is at least
      400 Mbps.
      It also checks min/max of 10s chunks.
      And checks if some of chunks is under the limit - raises warning.
      Prints the speeds to output log.
      Verified
      c385d63a
  6. Jun 21, 2021
  7. Apr 15, 2021
  8. Apr 13, 2021
    • Karel Koci's avatar
      selftests/target: improve check for interface being up · 1d74c1dc
      Karel Koci authored
      This changes check from carrier being up to just interface being up.
      That is actually the correct check we want to do. The carrier might be
      down if we are connected directly to board (not trough switch) and thus
      this test might fail even if everything is all right. In reality we want
      to check that interface is set to be up and thus is going to be up once
      carrier is up. This information is encoded in flags as lowest bit (this
      was discovered by checking flag value rather not from documentation). So
      this test now only checks if this bit is set or not.
      Verified
      1d74c1dc
    • Karel Koci's avatar
      nsfarm: add logging configuration for nsfarm tool · bf74a307
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      This allows better logging control when we run nsfarm tool directly.
      Verified
      bf74a307
    • Karel Koci's avatar
      imgs/base-alpine: improve bootstrap script · e189836d
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      This changes the order of setup. The original pretty much relied on
      configuration change happening before service actually started and
      system booted. This of course can't be ensured and is pretty fragile.
      
      In general we can change file access or any file content without waiting
      for system boot but once we want to communicate with services or to
      access the Internet we need to wait for system to actually boot.
      
      The clean effect here is the need to reload networking service once we
      modify interfaces after boot. This should have always been there.
      Verified
      e189836d
    • Karel Koci's avatar
      tests/sentinel: add dynfw-client and minipot tests · 1cee8784
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      These tests aim to check if firewall is well configured in such a way
      attackers can be caught by Sentinel.
      Verified
      1cee8784
    • Karel Koci's avatar
      tests: replace basic_isp fixture with two fixtures · 0b605356
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      This way we can have easy access to ISP container as well as to WAN
      configuration.
      This is required as we have to know WAN IPv4 address in some generic
      way. We could define constant but this way it is prepared for standard
      ISP being based rather on DHCP in the future.
      Verified
      0b605356
    • Karel Koci's avatar
      nsfarm/cli: add dedicated method to send ctrl+c character · 75a10b2c
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      This is only alias for sending ^C but this way it is way less cryptic in
      tests them self.
      Verified
      75a10b2c
    • Karel Koci's avatar
      tests/mark: add set of simple marks based on board mark · 7dde2147
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      The idea behind this is that we have more descriptive names of marks and
      thus it should be easier to understand why some tests are marked with
      given combination of boards as they are.
      At the same time it should be easier to go trough them at one location
      once we add new boards. The new board would have to be selectively added
      to appropriate marks and all tests using these marks would be
      automatically handled. Of course that does not solve it fully but still
      it reduces the burden on introducing new boards.
      Verified
      7dde2147
    • Karel Koci's avatar
      nsfarm/lxd: remove exclusive devices and define all devices in image · 4f971f15
      Karel Koci authored and Karel Koci's avatar Karel Koci committed
      This removes concept of exclusive device. The only use of it was to pass
      exclusive access to network interface but that is not essentially
      required as it is even more versatile to use macvlan as thus we can
      easily spawn multiple containers to simulate network.
      The only known use for physical device pass trough and thus exclusive is
      Wi-Fi. It won't be possible to use macvlan for it. At the same time this
      is not an issue as it is not expected that we are going to be reusing
      this interface in single tests run multiple times over and over. In the
      end there is no need to automatically suspend containers to steal
      devices as it has been implemented (and in reality not finished).
      
      The introduced device management now required all devices to be defined
      in image as attributes. This gives image definition control over name of
      this device in container. It is up to container user to assign
      appropriate real device for it. This is done using device map that is
      simply pair of attribute and real device specifier. This concept can be
      in future expanded to even encode additional configuration if have need
      for it.
      Verified
      4f971f15
    • Karel Koci's avatar
      tests: just rename files to be consistent · b36a51fc
      Karel Koci authored
      Verified
      b36a51fc