Commit e50047a2 authored by Rami Alshafi's avatar Rami Alshafi Committed by Kishen Maloor

Update Linux build and skip non-test CI jobs

Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
parent 8337f369
Pipeline #429 failed with stage
in 6 minutes and 20 seconds
---
image: gcc
Linux_Secured:
stage: build
before_script:
- apt update && apt -y install make autoconf
- set -o pipefail
- export VERBOSE=false
- export CCACHE_DISABLE=false
script:
- cd port/linux
- make DYNAMIC=1 IPV4=1 TCP=1 SECURE=1
Linux_Secured_Test:
stage: build
before_script:
......@@ -23,17 +12,6 @@ Linux_Secured_Test:
- cd port/linux
- make DYNAMIC=1 IPV4=1 TCP=1 SECURE=1 test
Linux_Unsecured:
stage: build
before_script:
- apt update && apt -y install make autoconf
- set -o pipefail
- export VERBOSE=false
- export CCACHE_DISABLE=false
script:
- cd port/linux
- make DYNAMIC=1 IPV4=1 TCP=1 SECURE=0
Linux_Unsecured_Test:
stage: build
before_script:
......
......@@ -40,16 +40,12 @@ class TestCoreResource: public testing::Test
virtual void SetUp()
{
oc_core_init();
#ifndef OC_SECURITY
oc_random_init();
#endif /* !OC_SECURITY */
}
virtual void TearDown()
{
oc_core_shutdown();
#ifndef OC_SECURITY
oc_random_destroy();
#endif /* !OC_SECURITY */
}
};
......
......@@ -207,10 +207,13 @@ CONSTRAINED_LIBS = libiotivity-lite-server.a libiotivity-lite-client.a \
PC = iotivity-lite-client.pc iotivity-lite-server.pc \
iotivity-lite-client-server.pc
all: $(CONSTRAINED_LIBS) $(SAMPLES) $(PC) $(SWIG)
all: $(CONSTRAINED_LIBS) $(SAMPLES) $(PC) $(UNIT_TESTS) $(SWIG)
test: $(UNIT_TESTS)
for test in $^ ; do ./$${test} ; done
test: all
LD_LIBRARY_PATH=./ ./apitest
LD_LIBRARY_PATH=./ ./messagingtest
LD_LIBRARY_PATH=./ ./platformtest
LD_LIBRARY_PATH=./ ./securitytest
.PHONY: test clean
......@@ -428,7 +431,8 @@ endif
clean:
rm -rf obj $(PC) $(CONSTRAINED_LIBS) $(API_TEST_OBJ_FILES) $(SECURITY_TEST_OBJ_FILES) $(PLATFORM_TEST_OBJ_FILES) $(MESSAGING_TEST_OBJ_FILES) $(UNIT_TESTS) $(STORAGE_TEST_DIR) $(CLOUD_TEST_OBJ_FILES) $(RD_CLIENT_TEST_OBJ_FILES)
rm -rf pki_certs
rm -rf $(API_TEST_OBJ_DIR)/*.gcda $(SECURITY_TEST_OBJ_DIR)/*.gcda $(PLATFORM_TEST_OBJ_DIR)/*.gcda $(MESSAGING_TEST_OBJ_DIR)/*.gcda
rm -rf pki_certs smart_home_server_linux_IDD.cbor
cleanall: clean
rm -rf ${all} $(SAMPLES) $(TESTS) ${OBT} ${SAMPLES_CREDS} $(MBEDTLS_PATCH_FILE) *.o
......
......@@ -23,7 +23,7 @@
#include <gtest/gtest.h>
extern "C" {
#include "port/oc_storage.h"
#include "port/oc_storage.h"
}
#ifdef OC_SECURITY
......@@ -32,50 +32,47 @@ static const char *file_name = "storage_store";
static uint8_t buf[100];
#endif /* OC_SECURITY */
class TestStorage: public testing::Test
{
protected:
virtual void SetUp()
{
}
class TestStorage : public testing::Test {
protected:
virtual void SetUp() {}
virtual void TearDown()
{
}
virtual void TearDown() {}
};
#ifdef OC_SECURITY
TEST_F(TestStorage, oc_storage_config_fail_with_length_over)
{
int ret = oc_storage_config("./storage_test_long_size_fail_storage_test_long_size_fail_storage_test_long_size_fail");
EXPECT_NE(0, ret);
int ret = oc_storage_config("./"
"storage_test_long_size_fail_storage_test_long_"
"size_fail_storage_test_long_size_fail");
EXPECT_NE(0, ret);
}
TEST_F(TestStorage, oc_storage_read_fail)
{
int ret = oc_storage_read(file_name, buf, 100);
EXPECT_NE(0, ret);
int ret = oc_storage_read(file_name, buf, 100);
EXPECT_NE(0, ret);
}
TEST_F(TestStorage, oc_storage_write_fail)
{
int ret = oc_storage_write(file_name, buf, 100);
EXPECT_NE(0, ret);
int ret = oc_storage_write(file_name, buf, 100);
EXPECT_NE(0, ret);
}
TEST_F(TestStorage, oc_storage_config)
{
int ret = oc_storage_config(path);
EXPECT_EQ(0, ret);
int ret = oc_storage_config(path);
EXPECT_EQ(0, ret);
}
TEST_F(TestStorage, oc_storage_write)
{
uint8_t str[100] = "storage";
int ret = oc_storage_write(file_name, str, strlen((char *)str));
EXPECT_LE(0, ret);
ret = oc_storage_read(file_name, buf, 100);
EXPECT_LE(0, ret);
EXPECT_STREQ(str, buf);
uint8_t str[100] = "storage";
int ret = oc_storage_write(file_name, str, strlen((char *)str));
EXPECT_LE(0, ret);
ret = oc_storage_read(file_name, buf, 100);
EXPECT_LE(0, ret);
EXPECT_STREQ((const char *)str, (const char *)buf);
}
#endif /* OC_SECURITY */
\ No newline at end of file
#endif /* OC_SECURITY */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment