firecracker-containerd: runtime/service_integ_test: Shouldn't use lsblk to validate

We currently use lsblk to validate that the stub drives have been created. However, we are lsblk is tied to the Debian image and the output, which we use for validation, is prone to change. A better and longer term solution would be write a piece of software that does something similarly to lsblk but has a strict output. This executable should be injected into the root image.

Something like:

Name        Size          StubDrive
vda         1M            N
vdb         512B          Y

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks. Yes! options=bind works

ctr --address /run/firecracker-containerd/containerd.sock --debug run --snapshotter firecracker-naive --runtime aws.firecracker --mount type=bind,src=/dev,dst=/hostdev,options=bind --tty --rm docker.io/library/debian:latest sh2
root@microvm:/# ls /dev
console  core  fd  full  mqueue  null  ptmx  pts  random  shm  stderr  stdin  stdout  tty  urandom  zero
root@microvm:/# ls /hostdev
block            initctl       loop6               pts       tty10  tty2   tty29  tty38  tty47  tty56  tty8     vsock
char             kmsg          loop7               random    tty11  tty20  tty3   tty39  tty48  tty57  tty9     zero
console          log           mem                 shm       tty12  tty21  tty30  tty4   tty49  tty58  ttyS0
core             loop-control  memory_bandwidth    snapshot  tty13  tty22  tty31  tty40  tty5   tty59  urandom
cpu              loop0         mqueue              stderr    tty14  tty23  tty32  tty41  tty50  tty6   vcs
cpu_dma_latency  loop1         net                 stdin     tty15  tty24  tty33  tty42  tty51  tty60  vcs1
disk             loop2         network_latency     stdout    tty16  tty25  tty34  tty43  tty52  tty61  vcsa
fd               loop3         network_throughput  tty       tty17  tty26  tty35  tty44  tty53  tty62  vcsa1
full             loop4         null                tty0      tty18  tty27  tty36  tty45  tty54  tty63  vda
hugepages        loop5         ptmx                tty1      tty19  tty28  tty37  tty46  tty55  tty7   vdb

We can just use a module like https://godoc.org/github.com/google/cadvisor/utils/sysfs without building a standalone tool and parsing its output.