Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Eurotech
*******************************************************************************/
// Content with portions generated by generative AI platform
Copy link
Preview

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding AI generation comments to existing files is not recommended as it doesn't accurately represent the contribution nature. This comment should either be removed or made more specific to only the lines that were actually AI-generated.

Suggested change
// Content with portions generated by generative AI platform

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required by Eclipse

package org.eclipse.kura.net.configuration;

public enum NetworkConfigurationPropertyNames {
Expand Down Expand Up @@ -61,6 +62,7 @@ public enum NetworkConfigurationPropertyNames {
CONFIG_WIFI_INFRA_BGSCAN,
CONFIG_WIFI_INFRA_PING_AP,
CONFIG_WIFI_INFRA_IGNORE_SSID,
CONFIG_802_1X_PASSWORD,
CONFIG_WIFI_MASTER_SSID,
CONFIG_WIFI_MASTER_BROADCAST_ENABLED,
CONFIG_WIFI_MASTER_RADIO_MODE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Contributors:
* Eurotech
*******************************************************************************/
// Content with portions generated by generative AI platform
Copy link
Preview

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding AI generation comments to existing files is not recommended as it doesn't accurately represent the contribution nature. This comment should either be removed or made more specific to only the lines that were actually AI-generated.

Suggested change
// Content with portions generated by generative AI platform

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required by Eclipse

package org.eclipse.kura.net.configuration;

import java.util.HashMap;
Expand Down Expand Up @@ -301,6 +302,9 @@ private static void getWifiInfraDefinition(Tocd tocd, String ifaceName) {
NetworkConfigurationPropertyNames.CONFIG_WIFI_INFRA_IGNORE_SSID, Tscalar.BOOLEAN)
.withDefault(String.valueOf(NetworkConfigurationConstants.DEFAULT_WIFI_IGNORE_SSID_VALUE))
.build());

tocd.addAD(builder(String.format(PREFIX + "%s.config.802-1x.password", ifaceName),
NetworkConfigurationPropertyNames.CONFIG_802_1X_PASSWORD, Tscalar.PASSWORD).build());
}

private static void getWifiCommonDefinition(Tocd tocd, String ifaceName) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Eurotech and/or its affiliates and others
# Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -79,6 +79,7 @@ CONFIG_WIFI_MASTER_CHANNEL=The wifi channel to use.
CONFIG_WIFI_MASTER_IGNORE_SSID=Specify if the SSID broadcast is ignored.
CONFIG_WIFI_MASTER_PAIRWISE_CIPHERS=Pariwise Ciphers.
CONFIG_WIFI_MASTER_GROUP_CIPHERS=Group Ciphers.
CONFIG_802_1X_PASSWORD=The password for 802.1X authentication.

CONFIG_MODEM_ENABLED=Enable the interface.
CONFIG_MODEM_IDLE=The idle option of the PPP daemon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void shouldWrapStringPasswords() throws KuraException {
givenConfigurationProperty("net.interface.1-4.config.password", "foo");
givenConfigurationProperty("net.interface.wlp1s0.config.wifi.master.passphrase", "bar");
givenConfigurationProperty("net.interface.wlp1s0.config.wifi.infra.passphrase", "baz");
givenConfigurationProperty("net.interface.wlp1s0.config.802-1x.password", "qux");

whenConfigurationPropertiesAreRetrieved();

Expand All @@ -107,6 +108,8 @@ public void shouldWrapStringPasswords() throws KuraException {
new Password(new char[] { 'b', 'a', 'r' }));
thenReturnedPropertyEqualsPassword("net.interface.wlp1s0.config.wifi.infra.passphrase",
new Password(new char[] { 'b', 'a', 'z' }));
thenReturnedPropertyEqualsPassword("net.interface.wlp1s0.config.802-1x.password",
new Password(new char[] { 'q', 'u', 'x' }));

}

Expand All @@ -118,6 +121,8 @@ public void shouldNotChangeWrappedPasswords() throws KuraException {
new Password(new char[] { 'b', 'a', 'r' }));
givenConfigurationProperty("net.interface.wlp1s0.config.wifi.infra.passphrase",
new Password(new char[] { 'b', 'a', 'z' }));
givenConfigurationProperty("net.interface.wlp1s0.config.802-1x.password",
new Password(new char[] { 'q', 'u', 'x' }));

whenConfigurationPropertiesAreRetrieved();

Expand All @@ -127,6 +132,8 @@ public void shouldNotChangeWrappedPasswords() throws KuraException {
new Password(new char[] { 'b', 'a', 'r' }));
thenReturnedPropertyEqualsPassword("net.interface.wlp1s0.config.wifi.infra.passphrase",
new Password(new char[] { 'b', 'a', 'z' }));
thenReturnedPropertyEqualsPassword("net.interface.wlp1s0.config.802-1x.password",
new Password(new char[] { 'q', 'u', 'x' }));

}

Expand Down Expand Up @@ -324,7 +331,7 @@ private void thenComponentDefinitionHasBasicProperties() {

private void thenComponentDefinitionHasCorrectNumberOfResources() {
assertNotNull(this.ads);
assertEquals(189, this.ads.size());
assertEquals(190, this.ads.size());
}

private void thenReturnedPropertyEquals(final String key, final Object value) {
Expand Down Expand Up @@ -624,7 +631,7 @@ private void thenComponentDefinitionHasCorrectProperties() {
}

private void thenComponentDefinitionHasWifiProperties() {
assertEquals(50, this.ads.stream().filter(ad -> ad.getName().contains("wlp1s0")).count());
assertEquals(51, this.ads.stream().filter(ad -> ad.getName().contains("wlp1s0")).count());
}

private void thenComponentDefinitionHasModemProperties() {
Expand Down Expand Up @@ -845,8 +852,53 @@ private void thenComponentDefinitionHasWifiProperties(String interfaceName) {
assertEquals(WifiMode.UNKNOWN.name(), ad.getDefault());
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.infra.bgscan", interfaceName).equals(ad.getId())) {
assertTrue(ad.getDefault().isEmpty());
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.infra.pingAccessPoint", interfaceName).equals(ad.getId())) {
assertFalse(Boolean.parseBoolean(ad.getDefault()));
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.infra.ignoreSSID", interfaceName).equals(ad.getId())) {
assertFalse(Boolean.parseBoolean(ad.getDefault()));
adsConfigured++;
}

if (String.format("net.interface.%s.config.802-1x.password", interfaceName).equals(ad.getId())) {
assertTrue(ad.getDefault().isEmpty());
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.master.broadcast", interfaceName).equals(ad.getId())) {
assertFalse(Boolean.parseBoolean(ad.getDefault()));
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.master.ignoreSSID", interfaceName).equals(ad.getId())) {
assertFalse(Boolean.parseBoolean(ad.getDefault()));
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.master.pairwiseCiphers", interfaceName).equals(ad.getId())) {
assertEquals(WifiCiphers.CCMP_TKIP.name(), ad.getDefault());
adsConfigured++;
}

if (String.format("net.interface.%s.config.wifi.master.groupCiphers", interfaceName).equals(ad.getId())) {
assertEquals(WifiCiphers.CCMP_TKIP.name(), ad.getDefault());
adsConfigured++;
}

if (String.format("net.interface.%s.wifi.capabilities", interfaceName).equals(ad.getId())) {
assertTrue(ad.getDefault().isEmpty());
adsConfigured++;
}
}
assertEquals(24, adsConfigured);
assertEquals(33, adsConfigured);
}

private void thenComponentDefinitionHasModemProperties(String interfaceName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ private void thenComponentDefinitionHasInterfaceTypes() {
private void thenComponentDefinitionHasCorrectNumberOfResources() {
assertEquals(105, this.retrievedProperties.size());
assertNotNull(this.ads);
assertEquals(155, this.ads.size());
assertEquals(156, this.ads.size());
}

private void thenComponentDefinitionHasCorrectProperties() {
Expand Down