[ https://issues.apache.org/jira/browse/MESOS-3762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joseph Wu updated MESOS-3762: ----------------------------- Description: In order to write tests that exercise SSL with other components of Mesos, such as the HTTP scheduler library, we need to use the setup/teardown logic found in the {{SSLTest}} fixture. Currently, the test fixtures have separate inheritance structures like this: {code} SSLTest <- ::testing::Test MesosTest <- TemporaryDirectoryTest <- ::testing::Test {code} where {{::testing::Test}} is a gtest class. The plan is the following: # Change {{SSLTest}} to inherit from {{TemporaryDirectoryTest}}. This will require moving the setup (generation of keys and certs) from {{SetUpTestCase}} to {{SetUp}}. At the same time, *some* of the cleanup logic in the SSLTest will not be needed. # Move the logic of generating keys/certs into helpers, so that individual tests can call them when needed, much like {{MesosTest}}. # Write a child class of {{SSLTest}} which has the same functionality as the existing {{SSLTest}}, for use by the existing tests that rely on {{SSLTest}} or the {{RegistryClientTest}}. # Have {{MesosTest}} inherit from {{SSLTest}} (which might be renamed during the refactor). If Mesos is not compiled with {{--enable-ssl}}, then {{SSLTest}} could be {{#ifdef}}'d into any empty class. The resulting structure should be like: {code} MesosTest <- SSLTest <- TemporaryDirectoryTest <- ::testing::Test ChildOfSSLTest / {code} was: In order to write tests that exercise SSL with other components of Mesos, such as the HTTP scheduler library, we need to use the setup/teardown logic found in the {{SSLTest}} fixture. Currently, the test fixtures have separate inheritance structures like this: {code} SSLTest <- ::testing::Test MesosTest <- TemporaryDirectoryTest <- ::testing::Test {code} where {{::testing::Test}} is a gtest class. The plan is the following: 1) Change {{SSLTest}} to inherit from {{TemporaryDirectoryTest}}. This will require moving the setup (generation of keys and certs) from {{SetUpTestCase}} to {{SetUp}}. At the same time, *some* of the cleanup logic in the SSLTest will not be needed. 2) Move the logic of generating keys/certs into helpers, so that individual tests can call them when needed, much like {{MesosTest}}. 3) Have {{MesosTest}} inherit from {{SSLTest}} (which might be renamed during the refactor). If Mesos is not compiled with {{--enable-ssl}}, then {{SSLTest}} could be {{#ifdef}}'d into any empty class. 4) Write a child class of {{SSLTest}} which has the same functionality as the existing {{SSLTest}}, for use by the existing tests that rely on {{SSLTest}} or the {{RegistryClientTest}}. The resulting structure should be like: {code} MesosTest <- SSLTest <- TemporaryDirectoryTest <- ::testing::Test ChildOfSSLTest / {code} > Refactor SSLTest fixture such that MesosTest can use the same helpers. > ---------------------------------------------------------------------- > > Key: MESOS-3762 > URL: https://issues.apache.org/jira/browse/MESOS-3762 > Project: Mesos > Issue Type: Task > Components: test > Reporter: Joseph Wu > Assignee: Joseph Wu > Labels: mesosphere > > In order to write tests that exercise SSL with other components of Mesos, > such as the HTTP scheduler library, we need to use the setup/teardown logic > found in the {{SSLTest}} fixture. > Currently, the test fixtures have separate inheritance structures like this: > {code} > SSLTest <- ::testing::Test > MesosTest <- TemporaryDirectoryTest <- ::testing::Test > {code} > where {{::testing::Test}} is a gtest class. > The plan is the following: > # Change {{SSLTest}} to inherit from {{TemporaryDirectoryTest}}. This will > require moving the setup (generation of keys and certs) from > {{SetUpTestCase}} to {{SetUp}}. At the same time, *some* of the cleanup > logic in the SSLTest will not be needed. > # Move the logic of generating keys/certs into helpers, so that individual > tests can call them when needed, much like {{MesosTest}}. > # Write a child class of {{SSLTest}} which has the same functionality as the > existing {{SSLTest}}, for use by the existing tests that rely on {{SSLTest}} > or the {{RegistryClientTest}}. > # Have {{MesosTest}} inherit from {{SSLTest}} (which might be renamed during > the refactor). If Mesos is not compiled with {{--enable-ssl}}, then > {{SSLTest}} could be {{#ifdef}}'d into any empty class. > The resulting structure should be like: > {code} > MesosTest <- SSLTest <- TemporaryDirectoryTest <- ::testing::Test > ChildOfSSLTest / > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)