Fernandine Wars
The Fernandine Wars (from the Portuguese Guerras Fernandinas) were a series of three conflicts (1369–70, 1372–73, 1381–82) between the Kingdom of Portugal under King Ferdinand I and the Crown of Castile under Kings Henry II and later John I. They were fought over Ferdinand's claim to the Castilian succession after the murder of King Peter of Castile in 1369. After signing  the Treaty of Salvaterra there was a period of civil war (April 1383 - August 1385 Crisis) (1383 - 1385 Portuguese interregnum) in Portugal without a ruling king. This was part of the Hundred Years' War. Treaty of Salvaterra 
The Treaty of Salvaterra de Magos was an agreement signed in 1383 between Portugal and Castile in order to end a period known in Portugal as the Fernandine Wars (after the name of Fernando I). To celebrate the peace between the two kingdoms, king Fernando I of Portugal agreed on the marriage of his daughter and heir, Beatrice of Portugal, with king John I of Castile. However, to avoid the union of the two countries,  this pre-nuptial agreement established the rules to the succession for the two thrones. It was never Fernando's intention to form a union of the kingdoms of Portugal and Castile. Therefore, it was agreed that following his death his wife, queen Leonor Telles de Menezes would assume the regency in Portugal until the son of Beatrice and John would reach 14 years old, when he would become the future king of Portugal. The main clauses of the Treaty of Salvaterra stipulated:

The separation between the kingdoms of Portugal and Castile only could be eliminated with the consent of the Cortes;
The recognition of Beatrice and her husband as kings of Portugal (him, as king consort), if Fernando I would die without any other male heir;
The succession in the throne of Portugal to the offspring of Beatrice and her husband;
The succession in the throne of Portugal to John of Castille and his offspring of the first marriage, if Beatrice would die childless before him, but the Portuguese naturals (property owners) must to receive him as their king;
That queen Leonor Telles de Menezes should remain regent of the kingdom if Fernando I would die without any other heirs and while Beatrice didn't have a 14-year-old son;
And other less important clauses (included in Chronicle of king Fernando I, by Fernão Lopes, Chapter CLVII). In the famous Cortes of Coimbra (1385), João das Regras, a lawyer supporting John Master of Aviz claims to the throne of Portugal, defended that due to a breach of the Treaty of Salvaterra, Beatrice and John I of Castile should be barred from ascending the Portuguese throne. References
 Cervera Pery, José. El poder naval en los reinos Hispánicos: la marina de la Edad Media. Madrid (1992) 
 Lopes, Fernão. Crónica do Senhor Rei D. Fernando Nono Rei de Portugal. Livraria Civilização. Porto (1966)
 Fernández Duro, Cesáreo. La Marina de Castilla. Madrid (1995) 
 Pereira, António Rodrigues. História da Marinha Portuguesa. Escola Naval. Lisboa (1983)
 Batista González, Juan. España estratégica. Guerra y diplomacia en la historia de España. Madrid (2007) 

Wars involving Portugal
Wars involving the Kingdom of Castile
Wars involving England
1370s in Europe
1380s in Europe
14th century in Portugal
14th century in Castile
Wars of succession involving the states and peoples of Europe