From 4c769bb2688dba75fa4087b83f9019e9e41a99f2 Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Sat, 28 Jul 2018 13:59:16 +0200 Subject: [PATCH] Add test for command raw device-get-by-mac-address Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- Makefile.am | 9 +++++++-- test/nitsi/test/raw-device-get-by-mac/.gitignore | 3 +++ test/nitsi/test/raw-device-get-by-mac/recipe | 6 ++++++ test/nitsi/test/raw-device-get-by-mac/settings.in | 8 ++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 test/nitsi/test/raw-device-get-by-mac/.gitignore create mode 100644 test/nitsi/test/raw-device-get-by-mac/recipe create mode 100644 test/nitsi/test/raw-device-get-by-mac/settings.in diff --git a/Makefile.am b/Makefile.am index dfe0788..4a0c4ea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -600,17 +600,22 @@ CLEANFILES += \ NITSI_TESTS = \ test/nitsi/test/hello-world \ - test/nitsi/test/make-check + test/nitsi/test/make-check \ + test/nitsi/test/raw-device-get-by-mac EXTRA_DIST += \ test/nitsi/test/hello-world/recipe \ test/nitsi/test/hello-world/settings \ test/nitsi/test/make-check/recipe.in \ test/nitsi/test/make-check/settings.in + test/nitsi/test/raw-device-get-by-mac/recipe\ + test/nitsi/test/raw-device-get-by-mac/settings.in + CLEANFILES += \ test/nitsi/test/make-check/recipe \ - test/nitsi/test/make-check/settings + test/nitsi/test/make-check/settings \ + test/nitsi/test/raw-device-get-by-mac/settings NITSI_ENVIRONMENT = diff --git a/test/nitsi/test/raw-device-get-by-mac/.gitignore b/test/nitsi/test/raw-device-get-by-mac/.gitignore new file mode 100644 index 0000000..8a9bd77 --- /dev/null +++ b/test/nitsi/test/raw-device-get-by-mac/.gitignore @@ -0,0 +1,3 @@ +/log +/recipe.log +/settings diff --git a/test/nitsi/test/raw-device-get-by-mac/recipe b/test/nitsi/test/raw-device-get-by-mac/recipe new file mode 100644 index 0000000..e22454e --- /dev/null +++ b/test/nitsi/test/raw-device-get-by-mac/recipe @@ -0,0 +1,6 @@ +include: ../../include/make-install +include: ../../include/network-settings +include: ../../include/network-reset +alice: port="$(network raw device-get-by-mac-address "52:54:00:8a:b8:b5")" +alice: echo $port +alice: [ "52:54:00:8a:b8:b5" = "$(cat /sys/class/net/${port}/address)" ] diff --git a/test/nitsi/test/raw-device-get-by-mac/settings.in b/test/nitsi/test/raw-device-get-by-mac/settings.in new file mode 100644 index 0000000..e0bc141 --- /dev/null +++ b/test/nitsi/test/raw-device-get-by-mac/settings.in @@ -0,0 +1,8 @@ +[GENERAL] +name = raw-device-get-by-mac +description = This test checks if 'network raw device-get-by-mac' return the correct device for a given mac +copy_from = ../../../../@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz +copy_to = /root/ + +[VIRTUAL_ENVIRONMENT] +path = ../../virtual-environment/basic -- 2.39.2