--- /dev/null
+##########################################################################
+# Copyright (c) 2017, ETH Zurich.
+# All rights reserved.
+#
+# This file is distributed under the terms in the attached LICENSE file.
+# If you do not find this file, copies can be found by writing to:
+# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
+##########################################################################
+
+import re, datetime
+import debug, tests
+from common import TestCommon, TimeoutError
+from results import RowResults, PassFailResult
+
+TEST_TIMEOUT = datetime.timedelta(minutes=8)
+
+
+class DevifTests(TestCommon):
+
+ def __init__(self, options):
+ super(DevifTests, self).__init__(options)
+
+ def get_module_name(self):
+ return "devif_test"
+
+ def boot(self, *args):
+ super(DevifTests, self).boot(*args)
+ self.set_timeout(TEST_TIMEOUT)
+
+ def get_modules(self, build, machine):
+ self.machine = machine.name
+ modules = super(DevifTests, self).get_modules(build, machine)
+ modules.add_module("sfn5122f", ["auto", "function=0"])
+ modules.add_module("devif_idc", ["core=1"])
+ modules.add_module(self.get_module_name(), ["core=0", self.OP])
+
+ return modules
+
+ def is_finished(self, line):
+ return line.startswith("SUCCESS")
+
+ def process_data(self, testdir, rawiter):
+ passed = False
+ for line in rawiter:
+ if "SUCCESS" in line:
+ passed = True
+ return PassFailResult(passed)
+
+@tests.add_test
+class DevifNetTest(DevifTests):
+ ''' Devif Net Test'''
+ name = "devif_net_test"
+ OP = "net"
+
+@tests.add_test
+class DevifIdcTest(DevifTests):
+ ''' Devif IDC Test'''
+ name = "devif_idc_test"
+ OP = "idc"
#include <devif/backends/descq.h>
-#define IDC_TEST
-#define SFN_TEST
#define NUM_ENQ 2
#define NUM_RX_BUF 1024
#define NUM_ROUNDS 32
struct list_ele* next;
};
-#ifdef SFN_TEST
static uint8_t udp_header[8] = {
0x07, 0xD0, 0x07, 0xD0,
0x00, 0x80, 0x00, 0x00,
err = sfn5122f_queue_destroy((struct sfn5122f_queue*) q);
- printf("SFN5122F direct device test ended\n");
+ printf("SUCCESS: SFN5122F direct device test ended\n");
}
-#endif
-#ifdef IDC_TEST
+
static errval_t descq_notify(struct descq* q)
{
errval_t err = SYS_ERR_OK;
USER_PANIC("Devq deregister tx failed \n");
}
- printf("Descriptor queue test end \n");
+ printf("SUCCESS: IDC queue\n");
}
-#endif
int main(int argc, char *argv[])
{
- //barrelfish_usleep(1000*1000*5);
errval_t err;
// Allocate memory
err = frame_alloc(&memory_rx, MEMORY_SIZE, NULL);
}
phys_tx = id.base;
-#ifdef SFN_TEST
- test_sfn5122f_device_direct();
- barrelfish_usleep(1000*1000*5);
-#endif
-#ifdef IDC_TEST
- test_idc_queue();
+
+ if (strcmp(argv[1], "net") == 0) {
+ test_sfn5122f_device_direct();
+ }
+
+ if (strcmp(argv[1], "idc") == 0) {
+ test_idc_queue();
+ }
+
barrelfish_usleep(1000*1000*5);
-#endif
}