【环境信息】
软件信息:
1) OS版本及分支:openEuler 22.03 (LTS-SP2)
2) 内核信息:5.10.0-152.0.0.78.oe2203sp2
【操作步骤】
1、yumdownloader --source apache-commons-net
2、rpm -i apache-commons-net-3.6-5.oe2203sp2.src.rpm
3、rpmbuild -ba apache-commons-net.spec
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.commons.net.SocketClientTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 s - in org.apache.commons.net.SocketClientTest
[INFO] Running org.apache.commons.net.ftp.FTPClientTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in org.apache.commons.net.ftp.FTPClientTest
[INFO] Running org.apache.commons.net.ftp.FTPClientConfigTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 s - in org.apache.commons.net.ftp.FTPClientConfigTest
[INFO] Running org.apache.commons.net.ftp.parser.MVSFTPEntryParserTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 s - in org.apache.commons.net.ftp.parser.MVSFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactoryTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 s - in org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactoryTest
[INFO] Running org.apache.commons.net.ftp.parser.NetwareFTPEntryParserTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in org.apache.commons.net.ftp.parser.NetwareFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.NTFTPEntryParserTest
[INFO] Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.038 s - in org.apache.commons.net.ftp.parser.NTFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.VMSFTPEntryParserTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in org.apache.commons.net.ftp.parser.VMSFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.OS400FTPEntryParserTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 s - in org.apache.commons.net.ftp.parser.OS400FTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.MLSxEntryParserTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ftp.parser.MLSxEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.FTPTimestampParserImplTest
Skipping Feb 29 test (not leap year or before Feb 29)
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 s - in org.apache.commons.net.ftp.parser.FTPTimestampParserImplTest
[INFO] Running org.apache.commons.net.ftp.parser.OS2FTPEntryParserTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.ftp.parser.OS2FTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.EnterpriseUnixFTPEntryParserTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ftp.parser.EnterpriseUnixFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.UnixFTPEntryParserTest
[INFO] Tests run: 21, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 s - in org.apache.commons.net.ftp.parser.UnixFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.MacOsPeterFTPEntryParserTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in org.apache.commons.net.ftp.parser.MacOsPeterFTPEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.FTPConfigEntryParserTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ftp.parser.FTPConfigEntryParserTest
[INFO] Running org.apache.commons.net.ftp.parser.OS400FTPEntryParserAdditionalTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in org.apache.commons.net.ftp.parser.OS400FTPEntryParserAdditionalTest
[INFO] Running org.apache.commons.net.ftp.TestConnectTimeout
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.044 s <<< FAILURE! - in org.apache.commons.net.ftp.TestConnectTimeout
[ERROR] testConnectTimeout(org.apache.commons.net.ftp.TestConnectTimeout) Time elapsed: 0.043 s <<< ERROR!
org.apache.commons.net.MalformedServerReplyException:
Could not parse response code.
Server Reply: SSH-2.0-OpenSSH_8.2
at org.apache.commons.net.ftp.TestConnectTimeout.testConnectTimeout(TestConnectTimeout.java:39)
[INFO] Running org.apache.commons.net.ftp.FTPCommandTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ftp.FTPCommandTest
[INFO] Running org.apache.commons.net.SubnetUtilsTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.SubnetUtilsTest
[INFO] Running org.apache.commons.net.smtp.SimpleSMTPHeaderTestCase
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 s - in org.apache.commons.net.smtp.SimpleSMTPHeaderTestCase
[INFO] Running org.apache.commons.net.nntp.TestThreader
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.nntp.TestThreader
[INFO] Running org.apache.commons.net.io.DotTerminatedMessageReaderTest
[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.io.DotTerminatedMessageReaderTest
[INFO] Running org.apache.commons.net.io.ToNetASCIIInputStreamTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.io.ToNetASCIIInputStreamTest
[INFO] Running org.apache.commons.net.imap.IMAPTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 s - in org.apache.commons.net.imap.IMAPTest
[INFO] Running org.apache.commons.net.util.Base64Test
[WARNING] Tests run: 28, Failures: 0, Errors: 0, Skipped: 19, Time elapsed: 0.007 s - in org.apache.commons.net.util.Base64Test
[INFO] Running org.apache.commons.net.util.UtilTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.util.UtilTest
[INFO] Running org.apache.commons.net.ntp.TestTimeInfo
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ntp.TestTimeInfo
[INFO] Running org.apache.commons.net.ntp.TimeStampTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ntp.TimeStampTest
[INFO] Running org.apache.commons.net.ntp.TestNtpClient
Running NTP service on port 58116/UDP
NTP packet from 127.0.0.1 mode=Client
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.006 s - in org.apache.commons.net.ntp.TestNtpClient
[INFO] Running org.apache.commons.net.ntp.TestNtpPacket
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.ntp.TestNtpPacket
[INFO] Running org.apache.commons.net.telnet.WindowSizeOptionHandlerTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.telnet.WindowSizeOptionHandlerTest
[INFO] Running org.apache.commons.net.telnet.EchoOptionHandlerTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.telnet.EchoOptionHandlerTest
[INFO] Running org.apache.commons.net.telnet.TerminalTypeOptionHandlerTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.telnet.TerminalTypeOptionHandlerTest
[INFO] Running org.apache.commons.net.telnet.TelnetClientTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 43.554 s - in org.apache.commons.net.telnet.TelnetClientTest
[INFO] Running org.apache.commons.net.telnet.SuppressGAOptionHandlerTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.telnet.SuppressGAOptionHandlerTest
[INFO] Running org.apache.commons.net.telnet.TelnetOptionTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.telnet.TelnetOptionTest
[INFO] Running org.apache.commons.net.telnet.SimpleOptionHandlerTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.apache.commons.net.telnet.SimpleOptionHandlerTest
[INFO] Running org.apache.commons.net.telnet.InvalidTelnetOptionExceptionTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.apache.commons.net.telnet.InvalidTelnetOptionExceptionTest
[INFO] Running org.apache.commons.net.tftp.TFTPTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.371 s - in org.apache.commons.net.tftp.TFTPTest
[INFO] Running examples.MainTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 s - in examples.MainTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] TestConnectTimeout.testConnectTimeout:39 » MalformedServerReply Could not pars...
[INFO]
[ERROR] Tests run: 278, Failures: 0, Errors: 1, Skipped: 19
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping Apache Commons Net
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:04 min
[INFO] Finished at: 2023-06-03T11:27:09+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test (default-test) on project commons-net: There are test failures.
[ERROR]
[ERROR] Please refer to /root/rpmbuild/BUILD/commons-net-3.6-src/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
error: Bad exit status from /var/tmp/rpm-tmp.OeFCrN (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.OeFCrN (%build)
【预期结果】编译成功
【实际结果】编译失败,有一条用例执行未通过
【附件信息】
repo:
[everything]
name=everything
baseurl=http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP2/rc2_openeuler-2023-05-25-18-39-41/everything/$basearch
enabled=1
gpgcheck=1
gpgkey=http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP2/rc2_openeuler-2023-05-25-18-39-41/everything/$basearch/RPM-GPG-KEY-openEuler
[EPOL]
name=EPOL
baseurl=http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP2/rc2_openeuler-2023-05-25-18-39-41/EPOL/main/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP2/rc2_openeuler-2023-05-25-18-39-41/OS/$basearch/RPM-GPG-KEY-openEuler
[source]
name=source
baseurl=http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP2/rc2_openeuler-2023-05-25-18-39-41/source/
enabled=1
gpgcheck=1
gpgkey=http://121.36.84.172/dailybuild/EBS-openEuler-22.03-LTS-SP2/rc2_openeuler-2023-05-25-18-39-41/source/$basearch/RPM-GPG-KEY-openEuler
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
报错日志:
[ERROR] testConnectTimeout(org.apache.commons.net.ftp.TestConnectTimeout) Time elapsed: 0.043 s <<< ERROR!
org.apache.commons.net.MalformedServerReplyException:
Could not parse response code.
Server Reply: SSH-2.0-OpenSSH_8.2
at org.apache.commons.net.ftp.TestConnectTimeout.testConnectTimeout(TestConnectTimeout.java:39)
testConnectTimeout函数代码:
public void testConnectTimeout() throws SocketException, IOException {
FTPClient client = new FTPClient();
client.setConnectTimeout(1000);
try {
// Connect to a valid host on a bogus port
// TODO use a local server if possible
client.connect("www.apache.org", 1234);
fail("Expecting an Exception");
}
catch (ConnectException se) {
assertTrue(true);
}
catch (SocketTimeoutException se) {
assertTrue(true);
}
catch (UnknownHostException ue) {
// Not much we can do about this, we may be firewalled
assertTrue(true);
}
}
testConnectTimeout中使用FTPClient对网站"www.apache.org"进行连接测试,由于FTPClient不支持通过协议SSH2进行SFTP连接,所以导致报错
正常在obs编译由于不能访问外网"www.apache.org",会触发SocketTimeoutException,上游对该情况直接判断True,相当于未进行测试,故对TestConnectTimeout进行移除处理,解决自编译失败
回归测试结果:通过
测试截图:
登录 后才可以发表评论