Commit 676e16a9 authored by chiaming2000's avatar chiaming2000
Browse files

Java admin API: make device "world wide name" accessable through admin

client getLog().getConfiguration().getWorldWideName().  
parent ebad8234
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -767,6 +767,7 @@ public class KineticAdminCLI {
            System.out.println("ProtocolVersion: "
                    + config.getProtocolVersion());
            System.out.println("SerialNumber: " + config.getSerialNumber());
            System.out.println("WorldWideName: " + config.getWorldWideName());
            System.out.println("SourceHash: " + config.getSourceHash());
            System.out.println("Vendor: " + config.getVendor());
            System.out.println("Version: " + config.getVersion());
+5 −0
Original line number Diff line number Diff line
@@ -305,6 +305,11 @@ public class DefaultKineticLog implements KineticLog {
                    .toStringUtf8());
        }

        if (configuration.hasWorldWideName()) {
            configurationInfo.setWorldWideName(configuration.getWorldWideName()
                    .toStringUtf8());
        }

        if (configuration.hasSourceHash()) {
            configurationInfo.setSourceHash(configuration.getSourceHash());
        }
+109 −96
Original line number Diff line number Diff line
@@ -27,9 +27,12 @@ public class Configuration {
    // name of the device. Have no clue what this should be...
    private String model;

	// Device Serial number (WWN) from the underlying drive
    // Device Serial number from the underlying drive
    private String serialNumber;

    // device WWN
    private String wwn = null;

    // This is the version of the software on the drive in dot notation
    // if this is not set or ends with "x" this is test code.
    private String version;
@@ -37,7 +40,8 @@ public class Configuration {
    // This is the date/time string of when the source was compiled
    private String compilationDate;

	// This is the git hash of the source tree so that the exact code can be determined.
    // This is the git hash of the source tree so that the exact code can be
    // determined.
    private String sourceHash;

    // This is the protocol version of the software on the drive in dot notation
@@ -46,7 +50,8 @@ public class Configuration {
    // This is the date/time string of when the protocol source was compiled
    private String protocolCompilationDate;

	// This is the git hash of the protocol source tree so that the exact code can be determined.
    // This is the git hash of the protocol source tree so that the exact code
    // can be determined.
    private String protocolSourceHash;

    // the interfaces for this device. one per interface.
@@ -153,4 +158,12 @@ public class Configuration {
        this.tlsPort = tlsPort;
    }

    public String getWorldWideName() {
        return this.wwn;
    }

    public void setWorldWideName(String wwn) {
        this.wwn = wwn;
    }

}
+9 −9
Original line number Diff line number Diff line
@@ -19,17 +19,12 @@
 */
package com.seagate.kinetic.adminAPI;

import static org.testng.AssertJUnit.assertArrayEquals;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.assertNull;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import org.testng.Assert;

import static com.seagate.kinetic.KineticTestHelpers.setDefaultAcls;
import static com.seagate.kinetic.KineticTestHelpers.toByteArray;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNull;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;

import java.nio.charset.Charset;
import java.util.ArrayList;
@@ -59,6 +54,10 @@ import kinetic.client.KineticClient;
import kinetic.client.KineticClientFactory;
import kinetic.client.KineticException;

import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import com.google.protobuf.ByteString;
import com.seagate.kinetic.IntegrationTestCase;
import com.seagate.kinetic.IntegrationTestLoggerFactory;
@@ -2432,6 +2431,7 @@ public class KineticAdminTest extends IntegrationTestCase {
			assertTrue(configuration.getPort() >= 0);
			assertTrue(configuration.getTlsPort() >= 0);
			assertTrue(configuration.getSerialNumber().length() > 0);
            assertTrue(configuration.getWorldWideName().length() > 0);
			assertTrue(configuration.getSourceHash().length() > 0);
			assertTrue(configuration.getVendor().length() > 0);
			assertTrue(configuration.getVersion().length() > 0);
+1 −0
Original line number Diff line number Diff line
@@ -441,6 +441,7 @@ public class AdminAPISanityTest {
            assertTrue(configuration.getPort() >= 0);
            assertTrue(configuration.getTlsPort() >= 0);
            assertTrue(configuration.getSerialNumber().length() > 0);
            assertTrue(configuration.getWorldWideName().length() > 0);
            assertTrue(configuration.getSourceHash().length() > 0);
            assertTrue(configuration.getVendor().length() > 0);
            assertTrue(configuration.getVersion().length() > 0);